I'm working on an Angular2 app , I'm loading a data from a service to my component as a subject
public type1Choisi: any;
constructor(
public formeService: FormeService, ...) {
this.formeService._type1.subscribe(type1 => this.type1Choisi = type1);
}
and I'm using its value perfectly in my html view :
Type 1 selectionnè est :{{type1Choisi}}
but I'm not able to use it in my ts file of my component to do same processing :
if (this.type1Choisi ===102){ //Here type1Choisi doesn't give the value
ParamService.dormant.Porte_ON = 1.00;
}
am declaring my data in the service as subject
public _type1 = new Subject();
Anybody may tell me how can i use my sybject not ontly in my view but also in my ts code ????