i am new to Angular so i think i'm missing something.
i have 3 variables in my component, those variables are being filled after calling .subscribe method on an observable object.
like this
this.interRetard = this.technicienService.getInterRetard(id).subscribe(data => {
this.interRetard = data;
});
the interRetard variable contains a number, i can display its value in the html by doing {{interRetard}} .
the problem is that when i try to display it with console.log() it says :
Subscriber {closed: false, _parent: null, _parents: null, _subscriptions: Array(1), syncErrorValue: null, …}
and i need it to give me the exact value like it is displaying it in the html so i can assign it to the chart like this
public doughnutChartData:number[] = [this.interRetard , 5, 10];
Thank you.
this.interRetard2 times. Once to hold the subscription returned by the subscribe, and again when you assigndatato it inside the subscribe.this.interRetardis being assigned twice in your statement. You only need to assign it inside thesubscribecallback.interRetard?