Skip to content

Commit d24c136

Browse files
committed
fix(core): check against previous args and do nothing if they're the same references
1 parent 06b1ba3 commit d24c136

File tree

1 file changed

+7
-0
lines changed
  • libs/core/src/lib/directives

1 file changed

+7
-0
lines changed

libs/core/src/lib/directives/args.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
ViewContainerRef,
1010
} from '@angular/core';
1111
import { SPECIAL_INTERNAL_ADD_COMMENT } from '../renderer/constants';
12+
import { is } from '../utils/is';
1213

1314
@Directive({ selector: 'ng-template[args]' })
1415
export class NgtArgs {
@@ -31,6 +32,12 @@ export class NgtArgs {
3132
effect(() => {
3233
const value = this.args();
3334
if (value == null || !Array.isArray(value) || (value.length === 1 && value[0] === null)) return;
35+
36+
if (is.equ(value, this.injectedArgs)) {
37+
// we have the same value as before, no need to update
38+
return;
39+
}
40+
3441
this.injected = false;
3542
this.injectedArgs = value;
3643
this.createView();

0 commit comments

Comments
 (0)