当前位置:网站首页>Ng repeat executes a method when iterating over the last element
Ng repeat executes a method when iterating over the last element
2022-07-28 17:36:00 【yoki 】
It's very simple , Direct code .
// Define a repeat Array of $scope.lists = []; /** * Insert data into this array */ for (var i = 0; i < 1000; i++) { $scope.lists.push(' entry ' + i); } /** * repeat The last method that will be executed */ $scope.lastExecute = function () { console.log(' The last one is executed '); };
<div class="list"> <div class="item" ng-repeat="item in lists" ng-init="$last?lastExecute():''"> { {item}} </div> </div>as long as repeat The last element will execute lastExecute();
边栏推荐
- [Presto] details of the new version upgrade of Presto
- Shell脚本之免交互操作
- 掌握JVM面试专题和答案Offer拿到手软(附学习路线图)
- Verilog 每日一题(VL26 简易秒表)
- AMQP protocol details
- JS中为对象数组添加新对象结果导致数组中已存在的对象也修改了
- [ansible] the ansible shell encountered the problem of $symbol in awk when executing remote commands
- MySQL的触发器
- ng-repeat在迭代最后一个元素时执行一个方法
- How important is baseline safety from non child websites
猜你喜欢

高速电路设计实践——概述

Management of third-party technical services in product development

Arya-专业web自动化测试平台

LNMP source code compilation and installation

High speed circuit design practice -- Overview

With a total data volume of more than trillions of lines, Yuxi cigarette factory can easily deal with it by correctly selecting the timing database

Visual Object Class介绍PASCAL VOC数据集

Shell脚本之免交互操作

The practice of the beego framework of goweb development: Section II project initialization configuration

产品研发中第三方技术服务的管理
随机推荐
在PDF中插入文本水印
R语言 sub()用法
Selection and application of inductors in high speed circuits
AMQP协议详解
生信人的20个R语言习题
[atlas] atlas compilation error sorting (all)
Talk about what you know about publishing online (I)
Verilog 每日一题 (VL28 加减计数器)
JS中为对象数组添加新对象结果导致数组中已存在的对象也修改了
C # basic interview questions (with answers)
QR code generation of wechat applet with parameters
连接设计与测试平台——SystemVerilog 接口知识点总结
FreeRTOS learning notes
Master JVM interview topics and answers offer get soft (with learning roadmap)
Zero foundation uses unity3d to develop AR applications and download 3D models remotely
Verilog daily question (vl24 multi bit MUX synchronizer cross time domain output)
JVM性能调优
Deploy lamp platform -- compilation and installation of Linux, Apache, MySQL and PHP
【CDH】通过 ClouderaManager 配置CDH组件用 prometheus 监控采集JMX信息
Talk about the measurement of "post release problems"