I need to create instances of multiple components dynamically on the run.
I found several examples on the internet, including StackOverflow and angular.io page itself.
But always receiving exception ExpressionChangedAfterItHasBeenCheckedError when I'm assigning a value to the component model.
Even the dedicated example for this functionality throws the same exception: Angular.io article Plunker
ERROR Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: 'Bombasto'. It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?
Should I just ignore this or it can/should be fixed?
ExpressionChangedAfterItHasBeenCheckedError
error explains this behavior in great details – Max Koretskyi