Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Trying to use SPServices Promise with AngularJS Promise

$
0
0
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

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>