在controller中写currency过滤器是
$filter('currency')(12233243)
那如果要实现下面这个过滤器该怎么写呢?
<tr ng-repeat="product in products|filter:{brand: brandName}">
在controller中写currency过滤器是
$filter('currency')(12233243)
那如果要实现下面这个过滤器该怎么写呢?
<tr ng-repeat="product in products|filter:{brand: brandName}">
angular.module('yourApp').filter('brand', function(){
return function(input){
// 逻辑
}
})
我已经找到了。