Closed guillaumelachaud closed 5 years ago
My bad, actually it works. The example uses ngAfterViewInit(). On Angular 7 it throws an error:
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'width: 174'. Current value: 'width: 192'.
Using ngOnInit(), everything works smoothly.
Hi,
The ExpressionChangedAfterItHasBeenCheckedError
is quite common in Angular and it really depends what you are doing in your code and how it translated to change detection. You could solve this issue by manually running detectChanges
(https://angular.io/api/core/ChangeDetectorRef#detectchanges), but be aware of possible performance issues.
Hi!
It seems it's not possibly to set the image width dynamically. Is it expected ?
Thanks!