大佬教程收集整理的这篇文章主要介绍了AngularJS加载完成之后触发事件,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@{ Layout = null; } <!DOCTYPE html> <html ng-app="my_app"> <head> <Meta name="viewport" content="width=device-width" /> <title>Index</title> <script src="~/Scripts/jquery-1.10.2.min.js"></script> <script src="~/Scripts/angular.min.js"></script> <script type="text/javascript"> var app = angular.module("my_app",[]); app.controller('my_controller',function ($scope) { $scope.students = [ { id: 1,name: '张一' },{ id: 2,name: '李二' },{ id: 3,name: '王三' },{ id: 4,name: '马四' },{ id: 5,name: '鬼五' } ]; $scope.getstudent = function (id) { alert(id); } }); app.run(function ($timeout) {//等待AngularJS加载完成之后触发事件 var a = $timeout(function () { alert($('table tr').length); },1000); }); </script> </head> <body ng-controller="my_controller"> <table> <tr> <th>id</th> <th>name</th> </tr> <tr ng-repeat="item in students"> <td>{{item.iD}}</td> <td><a href="#" ng-click="getstudent(item.id);">{{item.namE}}</a></td> </tr> </table> </body> </html>
以上是大佬教程为你收集整理的AngularJS加载完成之后触发事件全部内容,希望文章能够帮你解决AngularJS加载完成之后触发事件所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。