Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.config(($locationProvider, $controllerProvider, $compileProvider, $filterProvider, $httpProvider, $provide) => {
- // pre assing bindings before constructor calls
- $compileProvider.preAssignBindingsEnabled(true);
- if (config.buildInfo.env !== 'development') {
- $compileProvider.debugInfoEnabled(false);
- }
- $httpProvider.useApplyAsync(true);
- this.registerFunctions.controller = $controllerProvider.register;
- this.registerFunctions.directive = $compileProvider.directive;
- this.registerFunctions.factory = $provide.factory;
- this.registerFunctions.service = $provide.service;
- this.registerFunctions.filter = $filterProvider.register;
- $provide.decorator('$http', [
- '$delegate',
- '$templateCache',
- ($delegate, $templateCache) => {
- const get = $delegate.get;
- $delegate.get = (url, config) => {
- if (url.match(/\.html$/)) {
- // some template's already exist in the cache
- if (!$templateCache.get(url)) {
- url += '?v=' + new Date().getTime();
- }
- }
- return get(url, config);
- };
- return $delegate;
- },
- ]);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement