(directives, text)
| 11051 | |
| 11052 | |
| 11053 | function addTextInterpolateDirective(directives, text) { |
| 11054 | var interpolateFn = $interpolate(text, true); |
| 11055 | if (interpolateFn) { |
| 11056 | directives.push({ |
| 11057 | priority: 0, |
| 11058 | compile: function textInterpolateCompileFn(templateNode) { |
| 11059 | var templateNodeParent = templateNode.parent(), |
| 11060 | hasCompileParent = !!templateNodeParent.length; |
| 11061 | |
| 11062 | // When transcluding a template that has bindings in the root |
| 11063 | // we don't have a parent and thus need to add the class during linking fn. |
| 11064 | if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); |
| 11065 | |
| 11066 | return function textInterpolateLinkFn(scope, node) { |
| 11067 | var parent = node.parent(); |
| 11068 | if (!hasCompileParent) compile.$$addBindingClass(parent); |
| 11069 | compile.$$addBindingInfo(parent, interpolateFn.expressions); |
| 11070 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 11071 | node[0].nodeValue = value; |
| 11072 | }); |
| 11073 | }; |
| 11074 | } |
| 11075 | }); |
| 11076 | } |
| 11077 | } |
| 11078 | |
| 11079 | |
| 11080 | function wrapTemplate(type, template) { |
no test coverage detected