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

Function addTextInterpolateDirective

test/angular/1.6/angular.js:10464–10488  ·  view source on GitHub ↗
(directives, text)

Source from the content-addressed store, hash-verified

10462
10463
10464 function addTextInterpolateDirective(directives, text) {
10465 var interpolateFn = $interpolate(text, true);
10466 if (interpolateFn) {
10467 directives.push({
10468 priority: 0,
10469 compile: function textInterpolateCompileFn(templateNode) {
10470 var templateNodeParent = templateNode.parent(),
10471 hasCompileParent = !!templateNodeParent.length;
10472
10473 // When transcluding a template that has bindings in the root
10474 // we don't have a parent and thus need to add the class during linking fn.
10475 if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);
10476
10477 return function textInterpolateLinkFn(scope, node) {
10478 var parent = node.parent();
10479 if (!hasCompileParent) compile.$$addBindingClass(parent);
10480 compile.$$addBindingInfo(parent, interpolateFn.expressions);
10481 scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
10482 node[0].nodeValue = value;
10483 });
10484 };
10485 }
10486 });
10487 }
10488 }
10489
10490
10491 function wrapTemplate(type, template) {

Callers 1

collectDirectivesFunction · 0.70

Calls 1

$interpolateFunction · 0.70

Tested by

no test coverage detected