Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular
- .module('cribsApp')
- .controller('cribsController', function($scope, cribsFactory) {
- $scope.cribs;
- cribsFactory.getCribs().then(function (data) {
- $scope.cribs = data;
- console.log($scope.cribs);
- });
- console.log($scope.cribs);
- });
- angular
- .module('cribsApp')
- .factory('cribsFactory', function ($http) {
- function getCribs() {
- return $http.get('data/cribs.json');
- }
- return {
- getCribs: getCribs
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement