Relative Content

Tag Archive for angulardependency-injection

Injecting multiple implementations for the same provider in Angular

The problem I have the following setup in my Angular template: <mat-tab-group> <mat-tab *ngIf=”sees1″> <app-custom-table (columnButtonClick)=”service1.columnClicked($event)”> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees2″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees3″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees4″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees5″> <app-custom-table (columnButtonClick)=”service5.columnClicked($event)”> </app-custom-table> </mat-tab> </mat-tab-group> I want each of the app-custom-table‘s to be injected with a different service implementation in […]

Injecting multiple implementations for the same provider in Angular

The problem I have the following setup in my Angular template: <mat-tab-group> <mat-tab *ngIf=”sees1″> <app-custom-table (columnButtonClick)=”service1.columnClicked($event)”> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees2″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees3″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees4″> <app-custom-table> </app-custom-table> </mat-tab> <mat-tab *ngIf=”sees5″> <app-custom-table (columnButtonClick)=”service5.columnClicked($event)”> </app-custom-table> </mat-tab> </mat-tab-group> I want each of the app-custom-table‘s to be injected with a different service implementation in […]