$scope.AddTask = function () {
$scope.tasks.push([{
"taskName": $scope.taskName,
"priority": $scope.selectedP
}]);
};
$scope.tasks = [{
"taskId": 1,
"taskName": "task 1",
"priority": 1
}, {
"taskId": 2,
"taskName": "task 2",
"priority": 2
}, {
"taskId": 3,
"taskName": "task 3",
"priority": 3
}];
Encountered an issue with 'push' in AngularJS, receiving the error 'cannot read property 'push' of undefined'
Check out the app demo at: http://plnkr.co/edit/ObKoQn2tZ4evgJpKQBpH?p=preview