What is the best way to access the data of an observable.
data: DataModel[]; //this is the observable where the data is stored
dataID = null;
constructor(private someService: SomeService){}
ngOnInit() {
this.dataID = this.route.snapshot.params['id'];
this.someService.query(this.dataID).subscribe(res => this.data = res) //here I get all the data from the observable
}
If I need the data stored inside to use it, how could I put it in an array?