How to add object in array and show it on web-page?
http://plnkr.co/edit/19w1Q3XhoWQcpxm5SuxX?p=preview
$scope.add = function() {
$scope.items.push($scope.item);
$scope.item = '';
};
How to add object in array and show it on web-page?
http://plnkr.co/edit/19w1Q3XhoWQcpxm5SuxX?p=preview
$scope.add = function() {
$scope.items.push($scope.item);
$scope.item = '';
};
$scope.items.push({'item':$scope.item});so the item object will have the same structure of data than the others.