Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. angular
  2. .module('cribsApp')
  3. .controller('cribsController', function($scope, cribsFactory) {
  4. $scope.cribs;
  5. cribsFactory.getCribs().then(function (data) {
  6. $scope.cribs = data;
  7. console.log($scope.cribs);
  8. });
  9.  
  10. console.log($scope.cribs);
  11. });
  12.  
  13. angular
  14. .module('cribsApp')
  15. .factory('cribsFactory', function ($http) {
  16.  
  17. function getCribs() {
  18. return $http.get('data/cribs.json');
  19. }
  20.  
  21. return {
  22. getCribs: getCribs
  23. }
  24.  
  25. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement