angular.js - | How to write filter: {name: someText} using $filter in the controller?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-15 16:57:09
0
2
674

Writing currency filter in controller is

$filter('currency')(12233243)

How to write the following filter if you want to implement it?

<tr ng-repeat="product in products|filter:{brand: brandName}">
曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
Peter_Zhu

I've found it.

$scope.filteredProducts = $filter('filter')($scope.products, $scope.brand);
phpcn_u1582
angular.module('yourApp').filter('brand', function(){
    return function(input){
        // 逻辑
        
    }
})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template