I have a simple scenario, but just can't get it working!
In my view I display some text in a box with limited height.
The text is being fetched from the server, so the view updates when the text comes in.
Now I have an 'expand' button that has a ngIf
that should show the button if the text in the box is overflowing.
The problem is that because the text changes when it is fetched, the 'expand' button's condition turns to true
after Angular's change detection has finished...
So I get this error: Expression has changed after it was checked. Previous value: 'false'. Current value: 'true'.
Obviously the button does not show...
see this Plunker (check the console to see the error...)
Any idea how to make this work?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…