(directives, text)
| 10391 | |
| 10392 | |
| 10393 | function addTextInterpolateDirective(directives, text) { |
| 10394 | var interpolateFn = $interpolate(text, true); |
| 10395 | if (interpolateFn) { |
| 10396 | directives.push({ |
| 10397 | priority: 0, |
| 10398 | compile: function textInterpolateCompileFn(templateNode) { |
| 10399 | var templateNodeParent = templateNode.parent(), |
| 10400 | hasCompileParent = !!templateNodeParent.length; |
| 10401 | |
| 10402 | // When transcluding a template that has bindings in the root |
| 10403 | // we don't have a parent and thus need to add the class during linking fn. |
| 10404 | if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); |
| 10405 | |
| 10406 | return function textInterpolateLinkFn(scope, node) { |
| 10407 | var parent = node.parent(); |
| 10408 | if (!hasCompileParent) compile.$$addBindingClass(parent); |
| 10409 | compile.$$addBindingInfo(parent, interpolateFn.expressions); |
| 10410 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 10411 | node[0].nodeValue = value; |
| 10412 | }); |
| 10413 | }; |
| 10414 | } |
| 10415 | }); |
| 10416 | } |
| 10417 | } |
| 10418 | |
| 10419 | |
| 10420 | function wrapTemplate(type, template) { |
no test coverage detected