I'm currently in the process of documenting my first real AngularJs application, for which I use ngdocs syntax with grunt-ngdocs
I was wondering if there is a better way to annotate that my service method returns a promise (so you know that you should add .then () instead of accessing the returned object.
* @returns {object} returns a promise
Full service context:
module.factory('Authentication', ['$http', function ($http) { var token; function login(email, password) { return $http.post('/auth/login', {email: email, password: password}) .then(function (response) { if (response.data.token) { token = response.data.token; } }); } function getToken() { return token; } return { login: login, token: getToken, }; }]);
source share