Answer the question
In order to leave comments, you need to log in
Angular js push() method what's wrong?
Already tried everything, tell me what's wrong guys
TypeError: Cannot read property 'push' of undefined
at Scope.$scope.addCount ( localhost/adminka/assets/js/app/controllers/termsC... )
at fn (eval at ( localhost/adminka/assets/js/angular/angular.js:13231:15 ), :4:308)
at callback ( localhost/adminka/assets/js/angular/angular.js:23411:17 )
at Scope.$eval ( localhost/adminka/assets/js/angular/angular.js:15916:28 )
at Scope.$apply ( localhost/adminka/assets/js/angular/angular.js:16016:25 )
at HTMLSpanElement. ( localhost/adminka/assets/js/angular/angular.js:23416:23 )
at HTMLSpanElement.jQuery.event.dispatch (localhost/adminka/assets/js/jquery/dist/jquery.js:... )
at HTMLSpanElement.elemData.handle ( localhost/adminka/assets/js/jquery/dist/jquery.js:... )
Controller:
mainApp.controller('termsController',function($scope,Terms){
$scope.getTerms = function(title){
Terms.getTerms(title).then(function(data){
$scope.terms = data;
})
}
$scope.addTerm = function(term){
Terms.addTerm(term);
}
$scope.delTerm = function(term){
}
$scope.delEl=[];
$scope.addCount = function(term){
$scope.delEL.push(term);
console.log(term);
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question