I have angular component where I use providers
Here is code
@Component({
selector: 'app-service-desk-ticket-main-data',
templateUrl: './service-desk-ticket-main-data.component.html',
styleUrls: ['./service-desk-ticket-main-data.component.scss'],
providers: [
UserLinkStatisticService,
{ provide: OPEN_PROFILE_TRACKING_CATEGORY_TOKEN, useValue: STATISTIC.CATEGORY.SERVICE_DESK },
{ provide: OPEN_PROFILE_TRACKING_LOCATION_TOKEN, useValue: STATISTIC.LOCATION.SD_TICKETS_PAGE },
],
})
in component code I want to change value of OPEN_PROFILE_TRACKING_LOCATION_TOKEN
related on @Input
value
Here is pseudo code of Component
export class ServiceDeskTicketMainDataComponent implements OnInit {
@Input()
public model: ServiceDeskTicket;
@Input()
public isPopup = false;
@Output() subscriptionChanged = new EventEmitter<void>();
public readonly unsubscribeTitle =
'If you unsubscribe, you will only receive notifications when your name is mentioned on this ticket';
public location: string;
constructor(
private serviceDeskService: ServiceDeskService,
private popupService: PopupService,
private preloader: PreloaderService,
private cdr: ChangeDetectorRef,
private alertService: AlertService,
private statistic: ServiceDeskStatisticService,
) {}
public ngOnInit(): void {
this.location = this.isPopup ? STATISTIC.LOCATION.SD_TICKETS_PAGE_POPUP : STATISTIC.LOCATION.SD_TICKETS_PAGE;
}
}
Logic is in OnInit
. I need same logic, but for provider useValue