Hello,
I have this issue with http request to my server and I got returning as undefined in my app.component.ts file.
My provider function looks like this:
async getPostBySlug(slug){
let postBySlug=await this.get("posts?slug="+slug)
await postBySlug.subscribe((post:any)=>{
this.onePostBySlug=post
});
}
and then my app.component.ts function is starting on initializeApp() and looks like this:
private async onPushOpened(data) {
console.log(data)
let url = data.notification.payload.launchURL
console.log(url)
let slug = url.split('/')[4]
console.log(slug);
this.api.getPostBySlug(slug)
console.log(this.api.onePostBySlug)
//this.nav.push(DetailPage, {post: this.api.postBySlug})
}
Where I’m mistaken all of this?
Why I can’t get response value on my app.component?
Thanks