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

Function createBoundTranscludeFn

test/angular/1.7/angular.js:9870–9897  ·  view source on GitHub ↗
(scope, transcludeFn, previousBoundTranscludeFn)

Source from the content-addressed store, hash-verified

9868 }
9869
9870 function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
9871 function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
9872
9873 if (!transcludedScope) {
9874 transcludedScope = scope.$new(false, containingScope);
9875 transcludedScope.$$transcluded = true;
9876 }
9877
9878 return transcludeFn(transcludedScope, cloneFn, {
9879 parentBoundTranscludeFn: previousBoundTranscludeFn,
9880 transcludeControllers: controllers,
9881 futureParentElement: futureParentElement
9882 });
9883 }
9884
9885 // We need to attach the transclusion slots onto the `boundTranscludeFn`
9886 // so that they are available inside the `controllersBoundTransclude` function
9887 var boundSlots = boundTranscludeFn.$$slots = createMap();
9888 for (var slotName in transcludeFn.$$slots) {
9889 if (transcludeFn.$$slots[slotName]) {
9890 boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);
9891 } else {
9892 boundSlots[slotName] = null;
9893 }
9894 }
9895
9896 return boundTranscludeFn;
9897 }
9898
9899 /**
9900 * Looks for directives on the given node and adds them to the directive collection which is

Callers 2

compositeLinkFnFunction · 0.70
compileTemplateUrlFunction · 0.70

Calls 1

createMapFunction · 0.70

Tested by

no test coverage detected