Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myApp = angular.module('myApp',[]);
- myApp.controller('restaurantController',['$scope','$http', function($scope, $http){
- $http.get($scope.something).success(function (data){
- $scope.items = data;
- });
- $scope.orders = [];
- $scope.process = function(item){
- var cart = '{"name":"'+item.name+'","price":"'+item.quantity*parseInt(item.price)+'","quantity":"'+item.quantity+'"}';
- $scope.orders.push(cart);
- }
- }]);
- <div class="container" ng-repeat="order in orders">
- <h3>{{order.name}}</h3>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement