ConfirmDialog problem in Microsoft Edge
This is using Microsoft Edge v38.14393, angular 2.0.0, primeng beta 16, angular in dev mode.
Create template:
<p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425"></p-confirmDialog> <button type="text" (click)="confirm()" pButton icon="fa-check" label="Confirm"></button>
and component has code:
public confirm() { this.confirmationService.confirm({ message: 'Are you sure that you want to perform this action?', accept: () => { console.log('confirmed'); } }); }
Works fine in Chrome, in Edge I get the error "Expression has changed after it was checked." Tracked this down to the code in the ConfirmDialog template:
[style.display]="visible ? 'block' : 'none'"
When the dialog is accepted or rejected, the "visible" variable is changed and the dev mode checking is seeing that as a side-effect on Edge but not on Chrome. When I remove that binding, everything works fine. What is that binding doing? The component seems to work without it. Can it be removed to fix things in Edge? Is this just a problem with zone.js? I'm not well versed in change detection so I'm not sure the best way to get this working.
I've just looked at the example in the showcase page in Edge, and that problem does not occur.
Are you seeing this in the showcase, or have you built an application using the package from NPM?
This is with application using npm. The showcase doesn't do it but I think that's because showcase is in angular production mode. Back before showcase was streamlined I saw the same problem with the regular dialog in the showcase using edge. This error is from dev mode. See this thread: http://stackoverflow.com/questions/34868810/what-is-diff-between-production-and-development-mode-in-angular2. Explains a bit why its good to have dev mode but dev mode just wont work with this component in edge.
I'm also getting a similar problem. It works fine in chrome without any errors, however in Edge, it throws errors. I have a simple test project having a p-dialog like so:
<p-dialog header="header" [(visible)]="displayDialog" [responsive]="true" [modal]="true">
Setting displayDialog to true, shows the dialog. Closing it using the 'x' button, works fine. Setting displayDialog to false while submitting throws an error, after which the dialog cannot be opened any more. The error is:
Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.
at checkBinding (eval code:4757:17)
I am using primeng version 1.1.3
Can't replicate so please provide a plunkr that replicates the issue.