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

Function controllersBoundTransclude

test/angular/1.6/angular.js:10090–10123  ·  view source on GitHub ↗
(scope, cloneAttachFn, futureParentElement, slotName)

Source from the content-addressed store, hash-verified

10088 // This is the function that is injected as `$transclude`.
10089 // Note: all arguments are optional!
10090 function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {
10091 var transcludeControllers;
10092 // No scope passed in:
10093 if (!isScope(scope)) {
10094 slotName = futureParentElement;
10095 futureParentElement = cloneAttachFn;
10096 cloneAttachFn = scope;
10097 scope = undefined;
10098 }
10099
10100 if (hasElementTranscludeDirective) {
10101 transcludeControllers = elementControllers;
10102 }
10103 if (!futureParentElement) {
10104 futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
10105 }
10106 if (slotName) {
10107 // slotTranscludeFn can be one of three things:
10108 // * a transclude function - a filled slot
10109 // * `null` - an optional slot that was not filled
10110 // * `undefined` - a slot that was not declared (i.e. invalid)
10111 var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];
10112 if (slotTranscludeFn) {
10113 return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
10114 } else if (isUndefined(slotTranscludeFn)) {
10115 throw $compileMinErr('noslot',
10116 'No parent directive that requires a transclusion with slot name "{0}". ' +
10117 'Element: {1}',
10118 slotName, startingTag($element));
10119 }
10120 } else {
10121 return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
10122 }
10123 }
10124 }
10125 }
10126

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