json 데이터가 있고 장르와 같은 필터로 표시하고 싶습니다. 마지막 질문 : How to filter JSON-Data with AngularJs? 저에게 맞지 않습니다.AngularJs로 JSON 데이터를 필터링하는 방법
myapp.js
var myApp = angular.module('myApp', []);
myApp.controller('myApp', function($scope) {
$scope.isoffice = function(apps) {
return apps[0].genre === "office";
};
$scope.apps = [
{
"id": "stardict",
"genre": "aksesoris",
"name": "Stardict"
},
{
"id": "libreoffice",
"genre": "office",
"name": "LibreOffice"
}];
}
내 index.html을이
<div ng-repeat="app in apps | filter:isoffice">
{{apps[0].name}}
</div>
내가 somethink 누락합니까? 감사합니다 ..
앱 [0]. 게이머는 apps.genre이어야합니다. – dandavis
와우, 고마워요. 내게 맞습니다. 둘 다 .. :)) –