MCPcopy Create free account
hub / github.com/angular-ui/ui-router / controllersBoundTransclude

Function controllersBoundTransclude

test/angular/1.5/angular.js:9570–9603  ·  view source on GitHub ↗
(scope, cloneAttachFn, futureParentElement, slotName)

Source from the content-addressed store, hash-verified

9568 // This is the function that is injected as `$transclude`.
9569 // Note: all arguments are optional!
9570 function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
9571 var transcludeControllers;
9572 // No scope passed in:
9573 if (!isScope(scope)) {
9574 slotName = futureParentElement;
9575 futureParentElement = cloneAttachFn;
9576 cloneAttachFn = scope;
9577 scope = undefined;
9578 }
9579
9580 if (hasElementTranscludeDirective) {
9581 transcludeControllers = elementControllers;
9582 }
9583 if (!futureParentElement) {
9584 futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
9585 }
9586 if (slotName) {
9587 // slotTranscludeFn can be one of three things:
9588 // * a transclude function - a filled slot
9589 // * `null` - an optional slot that was not filled
9590 // * `undefined` - a slot that was not declared (i.e. invalid)
9591 var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
9592 if (slotTranscludeFn) {
9593 return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
9594 } else if (isUndefined(slotTranscludeFn)) {
9595 throw $compileMinErr('noslot',
9596 'No parent directive that requires a transclusion with slot name "{0}". ' +
9597 'Element: {1}',
9598 slotName, startingTag($element));
9599 }
9600 } else {
9601 return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
9602 }
9603 }
9604 }
9605 }
9606

Callers

nothing calls this directly

Calls 4

isScopeFunction · 0.70
isUndefinedFunction · 0.70
startingTagFunction · 0.70
boundTranscludeFnFunction · 0.70

Tested by

no test coverage detected