Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49170

Angularjs custom filter crashes

$
0
0

@amrayoub wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49170

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>