scotch-io / mean-machine-code

Code samples for the book: MEAN Machine
https://leanpub.com/mean-machine
MIT License
459 stars 228 forks source link

TypeError: Auth.getUser(...).success is not a function #41

Open ghost opened 8 years ago

ghost commented 8 years ago

http://stackoverflow.com/questions/33531336/angularjs-error-success-is-not-a-function

Had the same problem. Found it on StackOverflow.

bzdzeng commented 8 years ago

Getting the same error

Browser: TypeError: Auth.getUser(...).success is not a function

However, I have in mainCtrl: Auth.getUser() .then(function(data) { vm.user = data.data; }); });

This file uses authService.js so I looked in there. But, everything in the authService.js file is also switched to ".then()" not ".success()" so I don't know where it lies.