Skip to content
This repository was archived by the owner on Feb 9, 2020. It is now read-only.

Commit 21f3e6c

Browse files
committed
fix: add decorator and component methods to custom loader
Fixes #275
1 parent 560188f commit 21f3e6c

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

loader.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
(function() {'use strict';
88

9+
10+
function isFunction(value) {
11+
return typeof value === 'function';
12+
}
13+
914
/**
1015
* @description
1116
*
@@ -271,6 +276,18 @@ function setupModuleLoader(window) {
271276
*/
272277
constant: invokeLater('$provide', 'constant', 'unshift'),
273278

279+
/**
280+
* @ngdoc method
281+
* @name angular.Module#decorator
282+
* @module ng
283+
* @param {string} The name of the service to decorate.
284+
* @param {Function} This function will be invoked when the service needs to be
285+
* instantiated and should return the decorated service instance.
286+
* @description
287+
* See {@link auto.$provide#decorator $provide.decorator()}.
288+
*/
289+
decorator: invokeLaterAndSetModuleName('$provide', 'decorator'),
290+
274291
/**
275292
* @ngdoc method
276293
* @name angular.Module#animation
@@ -339,7 +356,20 @@ function setupModuleLoader(window) {
339356
* @description
340357
* See {@link ng.$compileProvider#directive $compileProvider.directive()}.
341358
*/
342-
directive: invokeLater('$compileProvider', 'directive'),
359+
directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
360+
361+
/**
362+
* @ngdoc method
363+
* @name angular.Module#component
364+
* @module ng
365+
* @param {string} name Name of the component in camel-case (i.e. myComp which will match as my-comp)
366+
* @param {Object} options Component definition object (a simplified
367+
* {@link ng.$compile#directive-definition-object directive definition object})
368+
*
369+
* @description
370+
* See {@link ng.$compileProvider#component $compileProvider.component()}.
371+
*/
372+
component: invokeLaterAndSetModuleName('$compileProvider', 'component'),
343373

344374
/**
345375
* @ngdoc method

0 commit comments

Comments
 (0)