angularJS自定义过滤器

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
});
app.filter('myfilter', function() { //可以注入依赖
    return function(text) {
        var newArguments= Array.prototype.slice.call(arguments);
        return text+newArguments.join(',');
    }
});
posted @ 2018-02-02 09:13  小小来了  阅读(75)  评论(0编辑  收藏  举报