(directives, text)
| 6949 | |
| 6950 | |
| 6951 | function addTextInterpolateDirective(directives, text) { |
| 6952 | var interpolateFn = $interpolate(text, true); |
| 6953 | if (interpolateFn) { |
| 6954 | directives.push({ |
| 6955 | priority: 0, |
| 6956 | compile: function textInterpolateCompileFn(templateNode) { |
| 6957 | // when transcluding a template that has bindings in the root |
| 6958 | // then we don't have a parent and should do this in the linkFn |
| 6959 | var parent = templateNode.parent(), hasCompileParent = parent.length; |
| 6960 | if (hasCompileParent) safeAddClass(templateNode.parent(), 'ng-binding'); |
| 6961 | |
| 6962 | return function textInterpolateLinkFn(scope, node) { |
| 6963 | var parent = node.parent(), |
| 6964 | bindings = parent.data('$binding') || []; |
| 6965 | bindings.push(interpolateFn); |
| 6966 | parent.data('$binding', bindings); |
| 6967 | if (!hasCompileParent) safeAddClass(parent, 'ng-binding'); |
| 6968 | scope.$watch(interpolateFn, function interpolateFnWatchAction(value) { |
| 6969 | node[0].nodeValue = value; |
| 6970 | }); |
| 6971 | }; |
| 6972 | } |
| 6973 | }); |
| 6974 | } |
| 6975 | } |
| 6976 | |
| 6977 | |
| 6978 | function getTrustedContext(node, attrNormalizedName) { |
no test coverage detected