angular-decorate

Use AngularJS' decorate function with ease
0 people use it

angular-decorate

Use AngularJS' decorate function with ease.

Removes the boilerplate code needed to decorate a service, so that you can decorate any service with this simple function call:

Setup

Load the file angular-decorate.js directly after angular.js:

Example

Overwrite AngularJS' templateCache.get() function to always append .html. ```javascript angular.module('app').decorate('$templateCache', function ($delegate) { var get = $delegate.get; $delegate.get = function (key) { return _get.call(get, key + ".html"); }; return $delegate; });

comments powered by Disqus
This page was last updated almost 3 years ago.