MCPcopy Create free account
hub / github.com/apache/cloudstack / addAttrInterpolateDirective

Function addAttrInterpolateDirective

tools/ngui/static/js/lib/angular.js:4602–4628  ·  view source on GitHub ↗
(node, directives, value, name)

Source from the content-addressed store, hash-verified

4600
4601
4602 function addAttrInterpolateDirective(node, directives, value, name) {
4603 var interpolateFn = $interpolate(value, true);
4604
4605 // no interpolation found -> ignore
4606 if (!interpolateFn) return;
4607
4608
4609 directives.push({
4610 priority: 100,
4611 compile: valueFn(function attrInterpolateLinkFn(scope, element, attr) {
4612 var $$observers = (attr.$$observers || (attr.$$observers = {}));
4613
4614 if (name === 'class') {
4615 // we need to interpolate classes again, in the case the element was replaced
4616 // and therefore the two class attrs got merged - we want to interpolate the result
4617 interpolateFn = $interpolate(attr[name], true);
4618 }
4619
4620 attr[name] = undefined;
4621 ($$observers[name] || ($$observers[name] = [])).$$inter = true;
4622 (attr.$$observers && attr.$$observers[name].$$scope || scope).
4623 $watch(interpolateFn, function interpolateFnWatchAction(value) {
4624 attr.$set(name, value);
4625 });
4626 })
4627 });
4628 }
4629
4630
4631 /**

Callers 1

collectDirectivesFunction · 0.85

Calls 2

$interpolateFunction · 0.85
valueFnFunction · 0.85

Tested by

no test coverage detected