Skip to content

Commit a0db2d9

Browse files
committed
Simplify namings
1 parent b33a645 commit a0db2d9

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

src/core/compile/compile.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
23942394
});
23952395

23962396
return function delayedNodeLinkFn(
2397-
ignoreChildLinkFn,
2397+
_ignoreChildLinkFn,
23982398
scope,
23992399
node,
24002400
rootElement,
@@ -2453,19 +2453,16 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
24532453
}
24542454

24552455
function addTextInterpolateDirective(directives, text) {
2456-
const interpolateFn = $interpolate(text, true);
2456+
const interpolateFn = $interpolate(text, true); // Create interpolation function
24572457
if (interpolateFn) {
24582458
directives.push({
24592459
priority: 0,
2460-
compile: function textInterpolateCompileFn() {
2461-
// When transcluding a template that has bindings in the root
2462-
// we don't have a parent and thus need to add the class during linking fn.
2463-
2464-
return function textInterpolateLinkFn(scope, node) {
2465-
scope.$watch(interpolateFn, (value) => {
2466-
node[0].nodeValue = value;
2467-
});
2468-
};
2460+
// When transcluding a template that has bindings in the root
2461+
// we don't have a parent and thus need to add the class during linking fn.
2462+
compile: () => (scope, node) => {
2463+
scope.$watch(interpolateFn, (value) => {
2464+
node[0].nodeValue = value; // Update text node with new interpolated value
2465+
});
24692466
},
24702467
});
24712468
}

src/core/interpolate/interpolate.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -353,19 +353,16 @@ export class InterpolateProvider {
353353
expressions,
354354
$$watchDelegate(scope, listener) {
355355
let lastValue;
356-
return scope.$watchGroup(
357-
parseFns,
358-
function interpolateFnWatcher(values, oldValues) {
359-
const currValue = compute(values);
360-
listener.call(
361-
this,
362-
currValue,
363-
values !== oldValues ? lastValue : currValue,
364-
scope,
365-
);
366-
lastValue = currValue;
367-
},
368-
);
356+
return scope.$watchGroup(parseFns, (values, oldValues) => {
357+
const currValue = compute(values);
358+
listener.call(
359+
this,
360+
currValue,
361+
values !== oldValues ? lastValue : currValue,
362+
scope,
363+
);
364+
lastValue = currValue;
365+
});
369366
},
370367
},
371368
);

0 commit comments

Comments
 (0)