PrimeNG Toast не отображается после первого вызова API - PullRequest
0 голосов
/ 08 мая 2019

Шаги:

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