【发布时间】:2018-06-01 05:30:43
【问题描述】:
ng2-toastr 消息在里面时工作正常:
data => {
this.toastr.info('OOPS!!!', 'Information!');
this.dictData = data;
console.log(this.dictData);
this.results = data.results;
console.log(this.results);
} ,
但是当它在里面时不起作用:
error => {
console.log("some error occured");
console.log(error.errorMessage);
this.toastr.error('OOPS!!!', 'Error!');
if (error.status === 404) {
this.router.navigate(['/errornotfound']);
}
}
无法理解为什么会这样。
非常感谢任何形式的帮助。
【问题讨论】:
-
在错误部分尝试 this.toastr.info 看看它是否有效。只是为了确保它与 toastr 中的错误方法无关
-
是的,我试过了,但没用
-
你能发布整个代码块吗?
-
这里是完整代码的 github 链接: