(directives, text)
| 8062 | |
| 8063 | |
| 8064 | function addTextInterpolateDirective(directives, text) { |
| 8065 | var interpolateFn = $interpolate(text, true); |
| 8066 | if (interpolateFn) { |
| 8067 | directives.push({ |
| 8068 | priority: 0, |
| 8069 | compile: function textInterpolateCompileFn(templateNode) { |
| 8070 | var templateNodeParent = templateNode.parent(), |
| 8071 | hasCompileParent = !!templateNodeParent.length; |
| 8072 | |
| 8073 | // When transcluding a template that has bindings in the root |
| 8074 | // we don't have a parent and thus need to add the class during linking fn. |
| 8075 | if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); |
| 8076 | |
| 8077 | return function textInterpolateLinkFn(scope, node) { |
| 8078 | var parent = node.parent(); |
| 8079 | if (!hasCompileParent) compile.$$addBindingClass(parent); |
| 8080 | compile.$$addBindingInfo(parent, interpolateFn.expressions); |
| 8081 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 8082 | node[0].nodeValue = value; |
| 8083 | }); |
| 8084 | }; |
| 8085 | } |
| 8086 | }); |
| 8087 | } |
| 8088 | } |
| 8089 | |
| 8090 | |
| 8091 | function wrapTemplate(type, template) { |
no test coverage detected