Advertisement
Guest User

Untitled

a guest
May 5th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. 'use strict';
  2.  
  3.  
  4. angular.module('coco')
  5. .controller('homeCtrl',['$scope','$http','SimpleCart', function ($scope,$http, cart) {
  6.  
  7.  
  8. cart.init();
  9.  
  10.  
  11. $http
  12. .get('/api/products')
  13. .then(function(products) {
  14. $scope.products = products.data;
  15. //
  16. // cart.addItem(products[0], 1);
  17. // cart.addItem(products[2], 2);
  18. // cart.addItem(products[4], 6);
  19. // cart.addItem(products[7]);
  20.  
  21. });
  22.  
  23.  
  24.  
  25.  
  26. // .post('/api/products', data, config)
  27. // .then(successCallback, errorCallback);
  28.  
  29.  
  30. }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement