本文实例讲述了AngularJS使用ng-repeat和ng-if实现数据的删选显示效果。分享给大家供大家参考,具体如下:
1.首先重复回顾一下ng-repeat指令
ng-repeat可以实现内容的重复显示,比如我们可以写如下代码
angular.module("myapp",[]).controller("mycontroller",function($scope){
$scope.data=[{name:"yu1",age:10,partment:"产品部"},{name:"yu2",age:11,{name:"yu3",age:12,partment:"事业部"},{name:"yu4",age:13,{name:"yu5",age:14,partment:"物资部"},{name:"yu6",age:15,partment:"物资部"}
]
})