MCPcopy Index your code
hub / github.com/angular-ui/ui-router / addTextInterpolateDirective

Function addTextInterpolateDirective

test/angular/1.2/angular.js:7026–7050  ·  view source on GitHub ↗
(directives, text)

Source from the content-addressed store, hash-verified

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) {

Callers 1

collectDirectivesFunction · 0.70

Calls 2

$interpolateFunction · 0.70
safeAddClassFunction · 0.70

Tested by

no test coverage detected