An angular provider for the unrest-js library
bower install -S ng-unrest
Configure unrest in your .config loader
angular
.module('app', ['ngUnrest'])
.config(['unrestProvider', function(unrestProvider) {
unrestProvider.configure( '/api', {
cacheTTL: 10 * 60 * 1000, // 10 minutes
cacheByDefault: false,
storage: localStorage
});
});
Load unrest and use within your services/controllers
angular
.module('app')
.controller('TestController', function AppsController(unrest) {
$scope.people = unrest('People').query();
});
karma start --single-run