Can someone help me with posting all types of runtime errors to the server? I've been searching for a solution, but haven't found what I need. Below is my code:
ngOnInit()
{
try{
this.CallGetBreakingNews();
}
catch(e)
{
console.log(e);
}
}
CallGetBreakingNews() {
this._service.GetBreakingNews().subscribe(
res => {
this._brNews = res;
let _list: Array<BreakingNews> = [];
for (let i = 0; i < this._brNews.length; i++) {
_list.push({
id: this._brNews[i].id,
name: this._brNews[i].name
});
}
this._brNews = _list;
});
}
I realize that in the CallGetBreakingNews method, the condition should be i<this._brNews.length. Why doesn't it go to catch as expected?
Your guidance is much appreciated. Thank you.