Skip to content

Commit 40642a4

Browse files
Inject CarService in AppComponent and display car list
1 parent 053e516 commit 40642a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { CarService } from './car.service';
1515
1616
<router-outlet></router-outlet>
1717
18-
<p>{{ carService.getCars() }}</p>
18+
<p>Car Listing: {{ display }}</p>
1919
2020
<img ngSrc="assets/logo.svg" alt="Angular logo" width="32" height="32" />
2121
`,
@@ -29,4 +29,5 @@ import { CarService } from './car.service';
2929
})
3030
export class AppComponent {
3131
carService = inject(CarService);
32+
display = this.carService.getCars().join(' ⭐️ ');
3233
}

0 commit comments

Comments
 (0)