I am working with Angular and WordPress rest API. Everything is going fine. But I have a little confusion with the behavior of the following code.
getpost(){
return this.http.get('someURL');
}
The above function is residing in a service. When I try to subscribe to the returned observable, I get an error. But the code below is working fine.
getpost(){
let someVAR = this.http.get('someURL');
return someVAR;
}
Please clarify WHY the above code is not returning observable. thanks in advance