I want to use observable to be able to run my code synchronously, I want to return a true value after i get the icons from the server so that i can use it. How do i do it ?
ngOnInit() {
this.addIcons().subscribe(data=>{
if(data===true)
//do something use the data
});
}
addIcons():Observable<boolean>{
this.Service.getIcons().subscribe(icons => {
return return observableOf(true);
});
return observableOf(false);
}