I'm implementing the following *ngIf. I know that I shouldn't technically call a function from within an *ngIf but it's needed for a hack:
<div *ngIf="!ddlAuthorsSelect2Bound && wireUpSelect2()"></div>
Anyway, the following implementation works fine:
<div *ngIf="wireUpSelect2()"></div>
However, for some reason this *ngIf is getting called multiple times. So I added the additional member variable check in the first code example to prevent the additional function call. This works as expected as well but ng2 writes the following error to the console:
Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'true'. Current value: 'false'.
Do you know of a way that I can suppress this error?