Hi All,

I'm trying a call a sharepoint REST API call from my Angular JS module and 
my promise is not returning me anything.. please  suggest me.. 

app.service('SinglePageCRUDService', ['$http', '$q', function ($http, $q) {

    //Define the http headers
    $http.defaults.headers.common.Accept = "application/json;odata=verbose";
    $http.defaults.headers.post['Content-Type'] = 
'application/json;odata=verbose';
    $http.defaults.headers.post['X-Requested-With'] = 'XMLHttpRequest';
    $http.defaults.headers.post['If-Match'] = "*";

    //Get the details
    this.getEmployees = function (listTitle) {
        var dfd = $q.defer();
        $http.defaults.headers.post['X-HTTP-Method'] = ""
       
        // var restUrl = "
dev2013-spapps.global.iff.com/fragrances/rtt/_api/lists/getbytitle('" + 
RTTInitiativeProfiles + "')";
        $http.get({
            url: "/
dev2013-spapps.global.iff.com/fragrances/rtt/_api/lists/getbytitle('RTT%20Initiative%20Profiles')
"
        }, { withCredentials: true })

              .success(function (data) {
                  dfd.resolve(data.d.results);
              }).error(function (data) {
                  dfd.reject("error");
              });
        return dfd.promise;
    }
}])

where is the mistake here.. Please help me..

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to