I'm about to ask a probably dummy question, but I really have issues with Observables, so I try.
I have an object which I want to be an Observable. Let's assume that the Object is of kind example like this :
export class Example {
public property1: string;
public property2: string;
}
In a component.ts I have something like this :
export class Component {
public myExample: Observable<Example>;
constructor(){}
myFunction() {
this._translateService.service
.get('SOMETHING')
.subscribe(response =>
myExample.property1 = response);
}
}
The _translateService is returning an Observable.
This example is not working. How can I implement something to reproduce this behavior ?
Thanks for any help.