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