Telegram Group & Telegram Channel
Декоратор @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



tg-me.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:
tg-me.com/sWebDev/3414

View MORE
Open in Telegram


Frontender Libs обзор библиотек JS CSS Telegram | DID YOU KNOW?

Date: |

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

How Does Telegram Make Money?

Telegram is a free app and runs on donations. According to a blog on the telegram: We believe in fast and secure messaging that is also 100% free. Pavel Durov, who shares our vision, supplied Telegram with a generous donation, so we have quite enough money for the time being. If Telegram runs out, we will introduce non-essential paid options to support the infrastructure and finance developer salaries. But making profits will never be an end-goal for Telegram.

Frontender Libs обзор библиотек JS CSS from us


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