javascript array push in angularjs not working - Cannot read property 'push' of undefined -
i work objects, wanted push data array
i don't see why not working angularjs 1.5 , works on jsfiddle site found on
vm.question.qda = [];
button click event calls code below
vm.question.qda.push( { "today":null, "day2":4, "day3":null, "day4":null, "day5":null, "day6":null, "day7":null, "title":"queries built", "id":null });
error:
angular.js:14199 typeerror: cannot read property 'push' of undefined
you need declare qda. , de push
vm.question= {qda:[]}; vm.question.qda.push( { "today":null, "day2":4, "day3":null, "day4":null, "day5":null, "day6":null, "day7":null, "title":"queries built", "id":null });
Comments
Post a Comment