/> 'Ngfor' снижается.
'ngif' снижается.
< /p>
< /blockquote>
Скриншот предупреждения о снижении. src = "https://i.sstatic.net/fjm4lc6t.png"/>
Ниже приведен stackblitz, повторяющий проблему.
Код: Выделить всё
import { Component } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import {
NgIf,
NgFor,
NgSwitch,
NgSwitchCase,
NgSwitchDefault,
} from '@angular/common';
@Component({
selector: 'app-root',
imports: [NgIf, NgFor, NgSwitch, NgSwitchCase, NgSwitchDefault],
template: `
Toggle Title
Hello from Angular 20!
{{i}}. {{item}}
Is One
Is Two
Is Default
`,
})
export class App {
ifCondition = true;
items = [1, 2, 3, 4, 5];
test = '1';
trackBy(index: number, item: any) {
return index;
}
}
bootstrapApplication(App);
Подробнее здесь: https://stackoverflow.com/questions/796 ... gswitchdef