Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. var myApp = angular.module('myApp',[]);
  2. myApp.controller('restaurantController',['$scope','$http', function($scope, $http){
  3. $http.get($scope.something).success(function (data){
  4. $scope.items = data;
  5. });
  6. $scope.orders = [];
  7. $scope.process = function(item){
  8. var cart = '{"name":"'+item.name+'","price":"'+item.quantity*parseInt(item.price)+'","quantity":"'+item.quantity+'"}';
  9. $scope.orders.push(cart);
  10. }
  11. }]);
  12.  
  13. <div class="container" ng-repeat="order in orders">
  14. <h3>{{order.name}}</h3>
  15. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement