當前位置:
首頁 >
angular 获取ng-repeat完成状态 $last
發布時間:2023/12/2
30
豆豆
生活随笔
收集整理的這篇文章主要介紹了
angular 获取ng-repeat完成状态 $last
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
$index $first $middle $last $odd $even
html
<ul><li ng-repeat="item in data" repeat-finish="renderFinish()">{{item.str}}</li> </ul>指令
app.directive('repeatFinish',function(){return {link: function(scope,element,attr){console.log(scope.$index)if(scope.$last == true){console.log('ng-repeat執行完畢')scope.$eval( attr.repeatFinish )}}} })ctrl里面
//controller里對應的處理函數 $scope.renderFinish = function(){console.log('渲染完之后的操作') }?
更多專業前端知識,請上 【猿2048】www.mk2048.com
總結
以上是生活随笔為你收集整理的angular 获取ng-repeat完成状态 $last的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 替换富文本里的px为rem
- 下一篇: js求渐升数的第100位