Open sidebar
(function(){ var AuthService = function($resource){ var getUsers = function(){ return $resource('http://api.local/users', {}, { query: { method: 'GET', isArray: true }, create: { method: 'POST' } }) }; return { getUsers: getUsers, }; }; // assigns the service/factory to the githubviewer var module = angular.module('githubViewer'); module.provider('AuthService', {$get:AuthService}); // console.log(module.provider('Auth', {$get:Auth}),'here'); //end of ify }()); //////////////////////////////////////// CONTROLLER HERE BELOW $scope.getUsers = function(){ var user = AuthService.getUsers.query(); console.log(user); }
Close sidebar
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting