Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var createProfile = function (profile) {
- var deferred = $q.defer();
- $http.post("localhost/profile", profile)
- .success(function(data, status){
- deferred.resolve(data);
- })
- .error(function(error, status){
- $rootScope.error = sitesettings.parseErrors(error);
- })
- .finally(function(){
- console.log('hello'); // **this message logs**
- });
- return deferred.promise;
- };
- profileFactory.createProfile (profile)
- .then(function (data) {
- // **works if successful**
- })
- .finally(function () {
- console.log('fin'); // **this never fires, successfully or on an error**
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement