MCPcopy
hub / github.com/angular-ui/ui-grid / addTextInterpolateDirective

Function addTextInterpolateDirective

lib/test/angular/1.8.0/angular.js:11053–11077  ·  view source on GitHub ↗
(directives, text)

Source from the content-addressed store, hash-verified

11051
11052
11053 function addTextInterpolateDirective(directives, text) {
11054 var interpolateFn = $interpolate(text, true);
11055 if (interpolateFn) {
11056 directives.push({
11057 priority: 0,
11058 compile: function textInterpolateCompileFn(templateNode) {
11059 var templateNodeParent = templateNode.parent(),
11060 hasCompileParent = !!templateNodeParent.length;
11061
11062 // When transcluding a template that has bindings in the root
11063 // we don't have a parent and thus need to add the class during linking fn.
11064 if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);
11065
11066 return function textInterpolateLinkFn(scope, node) {
11067 var parent = node.parent();
11068 if (!hasCompileParent) compile.$$addBindingClass(parent);
11069 compile.$$addBindingInfo(parent, interpolateFn.expressions);
11070 scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
11071 node[0].nodeValue = value;
11072 });
11073 };
11074 }
11075 });
11076 }
11077 }
11078
11079
11080 function wrapTemplate(type, template) {

Callers 1

collectDirectivesFunction · 0.70

Calls 1

$interpolateFunction · 0.70

Tested by

no test coverage detected