(directives, text)
| 10986 | |
| 10987 | |
| 10988 | function addTextInterpolateDirective(directives, text) { |
| 10989 | var interpolateFn = $interpolate(text, true); |
| 10990 | if (interpolateFn) { |
| 10991 | directives.push({ |
| 10992 | priority: 0, |
| 10993 | compile: function textInterpolateCompileFn(templateNode) { |
| 10994 | var templateNodeParent = templateNode.parent(), |
| 10995 | hasCompileParent = !!templateNodeParent.length; |
| 10996 | |
| 10997 | // When transcluding a template that has bindings in the root |
| 10998 | // we don't have a parent and thus need to add the class during linking fn. |
| 10999 | if (hasCompileParent) compile.$$addBindingClass(templateNodeParent); |
| 11000 | |
| 11001 | return function textInterpolateLinkFn(scope, node) { |
| 11002 | var parent = node.parent(); |
| 11003 | if (!hasCompileParent) compile.$$addBindingClass(parent); |
| 11004 | compile.$$addBindingInfo(parent, interpolateFn.expressions); |
| 11005 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 11006 | node[0].nodeValue = value; |
| 11007 | }); |
| 11008 | }; |
| 11009 | } |
| 11010 | }); |
| 11011 | } |
| 11012 | } |
| 11013 | |
| 11014 | |
| 11015 | function wrapTemplate(type, template) { |
no test coverage detected