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

Function createControllerDecorator

lib/test/angular/1.8.0/angular-mocks.js:2546–2560  ·  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

2544 * @return {Object} Instance of given controller.
2545 */
2546function createControllerDecorator() {
2547 angular.mock.$ControllerDecorator = ['$delegate', function($delegate) {
2548 return function(expression, locals, later, ident) {
2549 if (later && typeof later === 'object') {
2550 var instantiate = $delegate(expression, locals, true, ident);
2551 var instance = instantiate();
2552 angular.extend(instance, later);
2553 return instance;
2554 }
2555 return $delegate(expression, locals, later, ident);
2556 };
2557 }];
2558
2559 return angular.mock.$ControllerDecorator;
2560}
2561
2562/**
2563 * @ngdoc service

Callers 1

angular-mocks.jsFile · 0.70

Calls 1

instantiateFunction · 0.70

Tested by

no test coverage detected