MCPcopy
hub / github.com/angular-ui/ui-router / controllersBoundTransclude

Function controllersBoundTransclude

test/angular/1.7/angular.js:10607–10640  ·  view source on GitHub ↗
(scope, cloneAttachFn, futureParentElement, slotName)

Source from the content-addressed store, hash-verified

10605 // This is the function that is injected as `$transclude`.
10606 // Note: all arguments are optional!
10607 function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
10608 var transcludeControllers;
10609 // No scope passed in:
10610 if (!isScope(scope)) {
10611 slotName = futureParentElement;
10612 futureParentElement = cloneAttachFn;
10613 cloneAttachFn = scope;
10614 scope = undefined;
10615 }
10616
10617 if (hasElementTranscludeDirective) {
10618 transcludeControllers = elementControllers;
10619 }
10620 if (!futureParentElement) {
10621 futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
10622 }
10623 if (slotName) {
10624 // slotTranscludeFn can be one of three things:
10625 // * a transclude function - a filled slot
10626 // * `null` - an optional slot that was not filled
10627 // * `undefined` - a slot that was not declared (i.e. invalid)
10628 var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
10629 if (slotTranscludeFn) {
10630 return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
10631 } else if (isUndefined(slotTranscludeFn)) {
10632 throw $compileMinErr('noslot',
10633 'No parent directive that requires a transclusion with slot name "{0}". ' +
10634 'Element: {1}',
10635 slotName, startingTag($element));
10636 }
10637 } else {
10638 return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
10639 }
10640 }
10641 }
10642 }
10643

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