xori / ng-unrest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ng-unrest

An angular provider for the unrest-js library

Installation

bower install -S ng-unrest

Usage

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();
});

Tests

Karma

  karma start --single-run

About


Languages

Language:JavaScript 100.0%