angular.js - | filter: {name: someText}这种用$filter在controller中如何写啊
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-15 16:57:09
0
2
580

在controller中写currency过滤器是

$filter('currency')(12233243)

那如果要实现下面这个过滤器该怎么写呢?

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

répondre à tous(2)
Peter_Zhu

Je l'ai trouvé.

$scope.filteredProducts = $filter('filter')($scope.products, $scope.brand);
phpcn_u1582
angular.module('yourApp').filter('brand', function(){
    return function(input){
        // 逻辑
        
    }
})
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!