i’m trying to filtering the data json by id , it works great with the id , but when i put the model , it doesn’t’ work.
<ion-content ng-repeat="model in models | filter: { id: 9 }:true" >
.controller('BasintekModelsController',['$scope','$http', '$state',
function($scope, $http, $state) {
$http.get('js/data.json').success(function(data){
$scope.models = data;
$scope.whichmodel = $state.params.modelId;
//$scope.toggleStar = function(model){
// model.star = !model.star;
//}
});
but when i add the whichmodel
<ion-content ng-repeat="model in models | filter: { id: whichmodel}:true" >
the app crashes , here’s a screen shot
Any help, please