PrimeNG Toast not displaying after first API call

♀尐吖头ヾ 提交于 2019-12-25 02:23:09

问题


Steps:

1. Click save button
2. Data is saved and returns true
3. runs the code this.messageService.add({severity: "success", summary: "Success Message", detail: "Order submitted"});

expected result

-> toast message shows

actual result

-> toast does not show UNTIL i click on the page (anywhere on the page).

Below is what I have tried:

this.test.getdata(this.id).subscribe(res=> {
if(res.id == 0) {
     this.zone.run(() => {
           this.messageService.add({ key: 'custom', severity: 'info', summary: 
           'summery', detail: 'this is test' });
     });
     return;
}
})

来源:https://stackoverflow.com/questions/56041898/primeng-toast-not-displaying-after-first-api-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!