Notice: file_put_contents(): Write of 16913 bytes failed with errno=28 No space left on device in /var/www/tgoop/post.php on line 50
Frontender Libs - обзор библиотек JS / CSS@sWebDev P.3414
SWEBDEV Telegram 3414
Декоратор @SkipSelf() для исключения текущего провайдера из цепочки инъекций

@SkipSelf() в Angular заставляет DI пропустить текущий провайдер и искать зависимость в родительском инжекторе. Это полезно, если нужно использовать родительский провайдер вместо локального.

Пример:
@Injectable({ providedIn: 'root' })
export class ConfigService {
constructor(public config: string) {}
}

@Component({
selector: 'app-parent',
providers: [{ provide: ConfigService, useValue: new ConfigService('Parent Config') }],
template: `<app-child></app-child>`,
})
export class ParentComponent {}

@Component({
selector: 'app-child',
providers: [{ provide: ConfigService, useValue: new ConfigService('Child Config') }],
template: `{{ configService.config }}`,
})
export class ChildComponent {
constructor(@SkipSelf() public configService: ConfigService) {}
}

@SkipSelf() исключает локальный ConfigService в ChildComponent, используя родительский провайдер.

👉 @sWebDev
👍61



tgoop.com/sWebDev/3414
Create:
Last Update:

Декоратор @SkipSelf() для исключения текущего провайдера из цепочки инъекций

@SkipSelf() в Angular заставляет DI пропустить текущий провайдер и искать зависимость в родительском инжекторе. Это полезно, если нужно использовать родительский провайдер вместо локального.

Пример:

@Injectable({ providedIn: 'root' })
export class ConfigService {
constructor(public config: string) {}
}

@Component({
selector: 'app-parent',
providers: [{ provide: ConfigService, useValue: new ConfigService('Parent Config') }],
template: `<app-child></app-child>`,
})
export class ParentComponent {}

@Component({
selector: 'app-child',
providers: [{ provide: ConfigService, useValue: new ConfigService('Child Config') }],
template: `{{ configService.config }}`,
})
export class ChildComponent {
constructor(@SkipSelf() public configService: ConfigService) {}
}

@SkipSelf() исключает локальный ConfigService в ChildComponent, используя родительский провайдер.

👉 @sWebDev

BY Frontender Libs - обзор библиотек JS / CSS




Share with your friend now:
tgoop.com/sWebDev/3414

View MORE
Open in Telegram


Telegram News

Date: |

Select: Settings – Manage Channel – Administrators – Add administrator. From your list of subscribers, select the correct user. A new window will appear on the screen. Check the rights you’re willing to give to your administrator. The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added. On June 7, Perekopsky met with Brazilian President Jair Bolsonaro, an avid user of the platform. According to the firm's VP, the main subject of the meeting was "freedom of expression." Just at this time, Bitcoin and the broader crypto market have dropped to new 2022 lows. The Bitcoin price has tanked 10 percent dropping to $20,000. On the other hand, the altcoin space is witnessing even more brutal correction. Bitcoin has dropped nearly 60 percent year-to-date and more than 70 percent since its all-time high in November 2021.
from us


Telegram Frontender Libs - обзор библиотек JS / CSS
FROM American