SharePoint Hosted App with REST & AngularJS for MVC Javascript

I posted on Saturday about a SharePoint Hosted App with CSOM & AngularJS. Today I wanted to share the REST code leveraging a AngularJS Service and rendering it in a View with very little code.

You’ll need a reference for AngularJS in your app pages:

This is the HTML AngularJS Control that you put into your app page. You’ll see that the view really just shows exactly whats going to render.

The below is added to your App.js code to configure the AngularJS Controller. Notice how it makes iterating through the collection of Tasks really easy on the return from the AngularJS Service call (code block below).

The code below is the AngularJS Service to call the SharePoint REST service…again nice and short code base.

Hope this helps. I have uploaded the UbertTaskListAngularApp (REST sample) that you can grab and play with.

One thought on “SharePoint Hosted App with REST & AngularJS for MVC Javascript”

Leave a Reply