nibelu-ng
v0.0.2
Published
'AngularJS Wrappers for Nibelung'
Downloads
4
Readme
nibelu-ng: AngularJS Wrappers for Nibelung
Brings the power of nibelung to AngularJS.
This library does two things:
- It exposes nibelung as an Angular module and service.
angular.module('your-module', ['nibelu-ng'])
.service('yourService', function (nibelung) {
var cache = new nibelung.Hoard({
namespace: 'foo'
});
})
- It provides an $http-compatible
cache backed by Nibelung, which allows you to specify TTLs, persistence, and other
goodies for your
$http
calls.
.service('yourService', function (HttpHoard) {
var tenSecondCache = new HttpHoard({
namespace: 'httpCache',
ttlMilliseconds: 10000 // Cache records will expire 10 seconds after completion.
});
function getStuffWithTenSecondCache(url) {
return $http.get('foo/bar', {
cache: tenSecondCache
});
}
return {
getStuffWithTenSecondCache: getStuffWithTenSecondCache
};
});
See the original library for all the config options.
You can get it with the usual suspects:
bower install nibelu-ng
npm install nibelu-ng