MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / createControllerDecorator

Function createControllerDecorator

lib/test/angular/1.7.0/angular-mocks.js:2297–2311  ·  view source on GitHub ↗

* @ngdoc service * @name $controller * @description * A decorator for ng.$controller with additional `bindings` parameter, useful when testing * controllers of directives that use $compile#-bindtocontroller- `bindToController`. * * ## Example * * ```js * * // Directive defi

()

Source from the content-addressed store, hash-verified

2295 * @return {Object} Instance of given controller.
2296 */
2297function createControllerDecorator() {
2298 angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
2299 return function(expression, locals, later, ident) {
2300 if (later && typeof later === 'object') {
2301 var instantiate = $delegate(expression, locals, true, ident);
2302 var instance = instantiate();
2303 angular.extend(instance, later);
2304 return instance;
2305 }
2306 return $delegate(expression, locals, later, ident);
2307 };
2308 }];
2309
2310 return angular.mock.$ControllerDecorator;
2311}
2312
2313/**
2314 * @ngdoc service

Callers 1

angular-mocks.jsFile · 0.70

Calls 1

instantiateFunction · 0.70

Tested by

no test coverage detected