I'm new to angular and having some trouble setting this up. How do you setup a form and controller to push a new object into an existing array?
index.html:
<html ng-app="gemApp">
<div ng-controller="storeController as store">
<h3>Gems</h3>
<div ng-repeat="item in store.products" | orderBy:"name">
<h5>{{item.name}}</h5>
<h5>{{item.price | currency}}</h5>
</div>
</div>
app.js:
var app = angular.module("gemApp", []);
app.controller("storeController", storeController)
function storeController(){
this.products = gems;
}
var gems = [
{ name: 'Azurite', price: 2.95 },
{ name: 'Bloodstone', price: 5.95 },
{ name: 'Zircon', price: 3.95 }
];
gems
?