My server always returns the data as {meta:<> , reply:<>}. so, In my angular service, I am trying just to return the reply part
Below doesn't work
function get(url) {
     return $http.get(url)
        .success(function(d){ //d {meta:<> , reply:<>}
            return d.reply
        })
}
get("/a/b/c").then(function(d){
    console.log(d) // prints server response ({meta:<> , reply:<>}); not reply
})
but, if I use $q and resolve the promise, it works. But, I thought I could use the promise retuned by $http directly. Is there a logical difference between these two? what is wrong?
function get(url) {
    var deferred = $q.defer();
     $http.get(url)
        .success(function(d){ //d {meta:<> , reply:<>}
            deferred.resolve(d.reply)
        })
    return deferred.promise;
}
get("/a/b/c").then(function(d){
    console.log(d) // prints reply part of server response
})