Sounds like it might be a change detection issue. Are you using ChangeDetectionStrategy.OnPush
? If so, then you'd need to manually call ChangeDetectorRef
markForCheck()
after changes. Or you might try using the async
pipe, which would forgo the need for markForCheck()
ngOnInit() { this.cars = this.carService.getAll()}
and
<h2>BOF</h2><div *ngFor="let car of cars | async"> {{car.name}}</div><h2>EOF</h2>