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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -