angular2 http post with subscribe and catch



Why don't we use catch when calling http post construct? For example,





this.http.post(APPLICATION_HOST + '/employee/save', payload, {headers : headersJson})
.catch(err => {
console.log(err);
}



Http Post is lazily instantiated with subscribe method call. That's why the code below is better :-





Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm