Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyApp.factory('myService', function($http) {
- return {
- findAll: function() {
- return $http.get('/findAll')
- .then(function(result) {
- return result.data;
- });
- }
- }
- });
- MyApp.controller('UserController', ['$scope', '$http', 'myService', function($scope, $http, $log, myService) {
- // Whatever I do with myService here it gets undefined.
- //$scope.test = myService.findAll();
- //myService.findAll();
- }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement