-
Anonymous
Получение предупреждения о том, как NGIF/NGFOR/NGSWITCH/NGSWITCHCASE/NGSWITCHDEFAULT в моем проекте
Сообщение
Anonymous »
Попробуйте угловой 20. < /p>
/> '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);
demo
Подробнее здесь:
https://stackoverflow.com/questions/796 ... gswitchdef
1748599748
Anonymous
Попробуйте угловой 20. < /p>
/> 'Ngfor' снижается.
'ngif' снижается.
< /p>
< /blockquote>
Скриншот предупреждения о снижении. src = "https://i.sstatic.net/fjm4lc6t.png"/>
Ниже приведен stackblitz, повторяющий проблему.
[code]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);
[/code]
demo
Подробнее здесь: [url]https://stackoverflow.com/questions/79645238/getting-the-deprecation-warning-for-ngif-ngfor-ngswitch-ngswitchcase-ngswitchdef[/url]