angularjs - Angular $scope function not running -
i have ionic app works every function this. no errors, function never being executed
... $scope.contact = function(contactid){ console.log("test"); for(i=0;i<contacts.length;i++){ if(contacts[i].id == contactid){ return contacts[i]; } } } }; ... here entire controller:
.controller('contactsctrl', function($scope, $rootscope, auth, data, $localstorage, $stateparams) { $scope.token = $localstorage.token; $scope.tokenclaims = auth.gettokenclaims(); $scope.contacts = data.getapicontacts( function(list) { $scope.contacts = list; $localstorage.contacts = list; return list; }, function() { $rootscope.error = 'failed fetch contacts.'; } ); $scope.contact = function(contactid) { console.log("test"); (i = 0; < contacts.length; i++) { if (contacts[i].id == contactid) { return contacts[i]; } } } }; })
Comments
Post a Comment