I wanted to check whether a collection has value or not, I did like below and its working. Please suggest if we have any better approach...
I am checking if data
is []
then do nothing, else do something
let data = await this.http.post(_postsURL, {
headers: this.getPostAPIHeader()
}).toPromise();
if (data[0]) {
console.log("response yes ");
} else {
console.log("response no ");
}