タグ付けされた質問 「angular-filters」

15
コントローラーでフィルターを使用するには?
渡した引数に基づいてデータを返すフィルター関数を作成しました。私のコントローラーにも同じ機能が必要です。フィルター機能をコントローラーで再利用することは可能ですか? これは私がこれまでに試したことです: function myCtrl($scope,filter1) { // i simply used the filter function name, it is not working. }

8
AngularJsでng-repeatで(キー、値)をフィルタリングする方法は?
私は次のようなことをやろうとしています: <div ng-controller="TestCtrl"> <div ng-repeat="(k,v) in items | filter:hasSecurityId"> {{k}} {{v.pos}} </div> </div> AngularJsパーツ: function TestCtrl($scope) { $scope.items = { 'A2F0C7':{'secId':'12345', 'pos':'a20'}, 'C8B3D1':{'pos':'b10'} }; $scope.hasSecurityId = function(k,v) { return v.hasOwnProperty('secId'); } } しかし、どういうわけか、それは私にすべてのアイテムを見せています。(key、value)でフィルタリングするにはどうすればよいですか?

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.