(directives, text)
| 8878 | |
| 8879 | |
| 8880 | function addTextInterpolateDirective(directives, text) { |
| 8881 | var interpolateFn = $interpolate(text, true); |
| 8882 | if (interpolateFn) { |
| 8883 | directives.push({ |
| 8884 | priority: 0, |
| 8885 | compile: function textInterpolateCompileFn(templateNode) { |
| 8886 | var templateNodeParent = templateNode.parent(), |
| 8887 | hasCompileParent = !!templateNodeParent.length; |
| 8888 | |
| 8889 | // When transcluding a template that has bindings in the root |
| 8890 | // we don't have a parent and thus need to add the class during linking fn. |
| 8891 | if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); |
| 8892 | |
| 8893 | return function textInterpolateLinkFn(scope, node) { |
| 8894 | var parent = node.parent(); |
| 8895 | if (!hasCompileParent) compile.$$addBindingClass(parent); |
| 8896 | compile.$$addBindingInfo(parent, interpolateFn.expressions); |
| 8897 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 8898 | node[0].nodeValue = value; |
| 8899 | }); |
| 8900 | }; |
| 8901 | } |
| 8902 | }); |
| 8903 | } |
| 8904 | } |
| 8905 | |
| 8906 | |
| 8907 | function wrapTemplate(type, template) { |
no test coverage detected