HLJ 发布于
2018-08-15 13:30:23

AngularJS LimitTo过滤器

AngularJS LimitTo过滤器

html代码:
<body ng-app="AngularfilterApp">
  <div ng-controller="filterctrl">
  Default Array : {{samarry}}<br /><br />
  LimitTo Get Elements from Beginning:{{samarry | limitTo : 3}}<br /><br />
  LimitTo Get Elements from Ending:{{samarry | limitTo : -3}}<br /><br />
  Get Elements from String : {{samstr | limitTo : 4}}
  </div>
</body>
JavaScript代码:
<script>
var app = angular.module("AngularfilterApp", []);
app.controller("filterctrl", function ($scope) {
  $scope.samarry = [20, 10, 43, 5, 1, 4, 6]
  $scope.samstr = "tutlane.com";
});
</script>

当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2018-08-15/95.html
最后生成于 2023-06-18 18:29:53
此内容有帮助 ?
0