Returning success message with httpost in Angularjs
<p>I am making a call to an httpService for the purpose of posting data and want to display a message, for example if an error occured.</p>

<pre><code>(function () {
'use strict';

angular.module("adminSetup").controller("AccountController", ["$scope", "$location", "httpService", AccountController]);

function AccountController($scope, $location, httpService) {
    $scope.message = "";
    $scope.error = false;
    $scope.user = {
        username: '',
        password: '',
        firstname: '',
        lastname: '',
        email: '',
        city: ''
    }
    $scope.submitUser = function () {
        httpService.registerUser($scope.user,
            function (data) {
                $scope.message = data;
            },
            function (error)
            {
                $scope.message = error;
            });;
    }
}
})();
</code></pre>

<p>The service looks like this</p>

<pre><code>(function () {
"use strict"
angular.module("common.services").factory("httpService", ["$q", "$http", "appSettings", userAccountHttp])


function userAccountHttp($q, $http, appSettings) {
    var deferred = $q.defer();
    var registerUser = function (user) {
        $http({
            url: appSettings.serverPath + "Account/Register/",
            method: "POST",
            data: user
        }).then(function (data) {
            return deferred.resolve("Success");
        },
        function (response) {
            return deferred.reject(response.data.exceptionMessage);
        })
    }
    return {
        registerUser: registerUser
    };
}
</code></pre>

<p>})();</p>

<p>As it is at the moment the Http Status message is not returned by the Service  to the AccountController. How can I 'return' the status back to the Controller</p>