HLJ 发布于
2018-08-15 13:39:20

AngularJS自定义过滤器

上一篇文章:

AngularJS JSON过滤器

下一篇文章:

AngularJS $watch()函数

AngularJS自定义过滤器

html代码:
<body ng-app="angularcustomapp">
  <div ng-controller="CustomCtrl">
    <p>{{ name | convertUpper }}</p>
  </div>
</body>
JavaScript代码:
<script type="text/javascript">
var app = angular.module('angularcustomapp', []);
  app.filter('convertUpper', function () {
      return function (item) {
      return item.toUpperCase();
    };
  });
  app.controller('CustomCtrl', function ($scope) {
  $scope.name = 'Welcome to Tutlane.com';
});
</script>

当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2018-08-15/97.html
最后生成于 2023-06-18 18:29:55
上一篇文章:

AngularJS JSON过滤器

下一篇文章:

AngularJS $watch()函数

此内容有帮助 ?
0