π - Angular 17.0.3 Replacing the `context` object of an `EmbeddedViewRef` is deprecated.
uladzimir-miadzinski opened this issue Β· comments
Playground Link
No response
Description
Π‘ΡΠΎΠ»ΠΊΠ½ΡΠ»ΠΈΡΡ Ρ ΡΠ°ΠΊΠΎΠΉ ΠΏΡΠΎΠ±Π»Π΅ΠΌΠΎΠΉ (ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π½Π° Angular 17.0.3) Π²ΡΠ΄Π°Π΅Ρ ΠΎΡΠΈΠ±ΠΊΡ ΠΎΡΠ΅Π½Ρ ΡΠΈΠ»ΡΠ½ΡΠΌ ΡΠΏΠ°ΠΌΠΎΠΌ Π² console.
core.mjs:13703 Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.
ΠΎΠ½Π° ΠΈΠ΄Π΅Ρ ΠΈΠ· webpack:///node_modules/@tinkoff/ng-polymorpheus/fesm2015/tinkoff-ng-polymorpheus.js#97
ΡΠ°ΠΌ Π³Π΄Π΅ ΠΈΠ΄ΡΡ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡΠ°
ngOnChanges({ content }) {
var _a;
const context = this.getContext();
if (this.v) {
this.v.context = context; // <------- ΡΡΡ
}
ΡΠ»ΠΎΠ²ΠΈΠ»ΠΈ Π½Π° <tui-select>
ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ΅ (Π½Π° Π²ΡΠ΅Ρ
ΡΡΠΎ Π±ΡΠ»ΠΈ Π² ΠΏΡΠΈΠ»Π°Π³Π΅), Π»Π°Π³ΠΈ ΠΏΡΠΎΠΈΡΡ
ΠΎΠ΄ΡΡ ΠΏΡΠΈ ΠΎΡΠΊΡΡΡΡΡ
DevTools ΠΈΠ·-Π·Π° ΡΠΏΠ°ΠΌΠ° console.warn
.
/**
* @deprecated Replacing the full context object is not supported. Modify the context
* directly, or consider using a `Proxy` if you need to replace the full object.
* // TODO(devversion): Remove this.
*/
set context(value) {
if (ngDevMode) {
// Note: We have a warning message here because the `@deprecated` JSDoc will not be picked
// up for assignments on the setter. We want to let users know about the deprecated usage.
console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.');
}
this._lView[CONTEXT] = value;
}
Π΅ΡΠ»ΠΈ Π·Π°ΠΊΡΡΡΡ DevTools, ΡΠΎ Π»Π°Π³ΠΈ ΠΏΡΠΎΠΏΠ°Π΄Π°ΡΡ, Π½ΠΎ ΡΠ°Π·ΡΠ°Π±Π°ΡΡΠ²Π°ΡΡ Ρ Π·Π°ΠΊΡΡΡΡΠΌΠΈ DevTools Π½Π΅ ΠΎΡΠ΅Π½Ρ.
Π² ΠΏΡΠΎΠ΄Π΅ ΡΠΎΠΆΠ΅ Π½Π΅ Π»Π°Π³Π°Π΅Ρ. ΠΡΡΡ ΠΈΠ΄Π΅ΠΈ ΠΊΠ°ΠΊ ΠΏΠΎΠΏΡΠ°Π²ΠΈΡΡ ΠΌΠΎΠΆΠ½ΠΎ?
ΡΠ°ΠΊ ΠΆΠ΅ Π½Π°ΡΠ»ΠΈ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ:
Swapping out the context object for EmbeddedViewRef is no longer supported. Support for this was introduced with v12.0.0, but this pattern is rarely used. There is no replacement, but you can use simple assignments in most cases, or Object.assign , or alternatively still replace the full object by using a Proxy(seeNgTemplateOutlet` as an example).
https://github.com/angular/angular/blob/main/CHANGELOG.md
p.s. ΠΏΠΎΠΊΠ° ΠΊΠ°ΠΊ Π²ΠΎΡΠΊΡΡΠ°ΡΠ½Π΄ ΡΠ΄Π°Π»ΠΈΠ» ΠΈΠ· node_modules/@angular/core/fesm2022/core.mjs ΠΈ node_modules/@angular/core/esm2022/src/render3/view_ref.mjs ΡΡΠΎΡ console.warn ΡΡΠΎΠ± Π½Π΅ Π»Π°Π³Π°Π»ΠΎ, Π½ΠΎ Π½Π°Π΄ΠΎ Π± ΠΏΠΎΠΏΡΠ°Π²ΠΈΡΡ Π²ΡΠ΅ΡΠ°Π²Π½ΠΎ :)
Angular version
17.0.3
Taiga UI version
3.48.0
Which browsers have you used?
- Chrome
- Firefox
- Safari
- Edge
Which operating systems have you used?
- macOS
- Windows
- Linux
- iOS
- Android