(directives, text)
| 7024 | |
| 7025 | |
| 7026 | function addTextInterpolateDirective(directives, text) { |
| 7027 | var interpolateFn = $interpolate(text, true); |
| 7028 | if (interpolateFn) { |
| 7029 | directives.push({ |
| 7030 | priority: 0, |
| 7031 | compile: function textInterpolateCompileFn(templateNode) { |
| 7032 | // when transcluding a template that has bindings in the root |
| 7033 | // then we don't have a parent and should do this in the linkFn |
| 7034 | var parent = templateNode.parent(), hasCompileParent = parent.length; |
| 7035 | if (hasCompileParent) safeAddClass(templateNode.parent(), 'ng-binding'); |
| 7036 | |
| 7037 | return function textInterpolateLinkFn(scope, node) { |
| 7038 | var parent = node.parent(), |
| 7039 | bindings = parent.data('$binding') || []; |
| 7040 | bindings.push(interpolateFn); |
| 7041 | parent.data('$binding', bindings); |
| 7042 | if (!hasCompileParent) safeAddClass(parent, 'ng-binding'); |
| 7043 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 7044 | node[0].nodeValue = value; |
| 7045 | }); |
| 7046 | }; |
| 7047 | } |
| 7048 | }); |
| 7049 | } |
| 7050 | } |
| 7051 | |
| 7052 | |
| 7053 | function getTrustedContext(node, attrNormalizedName) { |
no test coverage detected