在第一次API调用后PrimeNG Toast不显示

时间:2019-05-08 13:24:29

标签: typescript angular7 primeng toast

步骤:

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"});

预期结果

-> toast message shows

实际结果

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

以下是我尝试的内容:

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;
}
})

0 个答案:

没有答案