Posts

Showing posts from May, 2015

SharePoint with Angular

I have been working on a SharePoint Intranet project that uses AngularJS. Here is some code sample for using Angular with SharePoint.  The sample code below basically is: Getting a items from a list Searching for items with Title containing "Test" Display the results from the list and search onto the page I have the following files appFactory.js - for handling the services call to SharePoint using both JSOM and REST app.js - the main application logic (including a custom directive) list.html - the html template for my directive The files contain are pasted below. ***appFactory.js********************************* var spServices = angular.module('spServices', []); //Factory with SharePoint call using JSOM spServices.factory('SPRestSearchFactory', ['$resource',   function ($resource) {       return $resource(_spPageContextInfo.siteAbsoluteUrl + "/_api/search/query/:searchtext", { searchtext: '@querytext' }, {   ...