Trying to use SPServices Promise with AngularJS Promise

Jan 21, 2014 at 3:09 PM
Edited Jan 21, 2014 at 11:07 PM
I've written a small SPA application with SPServices, but decided to rewrite most of it to use Promises and improve things in general. I've decided to write this application using AngularJS, which has it's own implementation of Promises and I'm not sure if this conflicts with SPServices.


Nvm solved issue.
Jan 21, 2014 at 3:49 PM
Edited Jan 21, 2014 at 11:07 PM
I solved the issue.
Jun 9, 2014 at 5:19 PM
i'm trying to use spservices to retrieve the sharepoint currently logged on userid and username - how did you get it to work with angular?
Jun 9, 2014 at 5:38 PM
Edited Jun 9, 2014 at 5:39 PM
diakonia wrote:
i'm trying to use spservices to retrieve the sharepoint currently logged on userid and username - how did you get it to work with angular?
Are you trying to use promises? If not, it works exactly the same with AngularJS. Here's an example of how I use it with promises:
            //Controller
    //GET CURRENT USER INFORMATION
    var currentUser = $().SPServices.SPGetCurrentUser({
                          webURL: "",   
                          fieldNames: ["ID","EMail","UserName","Title","Picture"],
                          debug: false
                        });
    $scope.SiteData.currentUser = currentUser;

           //My View
       <h1>{{SiteData.currentUser.Title}}</h1>
       <h3>{{SiteData.currentUser.EMail}}</h3>
There's currently an issue with getting the user ID through fildNames, see this post: https://spservices.codeplex.com/workitem/10265