Coding task · Angular course · Module 5: Services and DI

Practice: Injecting a Service

A function from @angular/core called in a field declaration provides a dependency without a constructor. This is the modern approach recommended for standalone components.

Task

Complete the component so that it gets SamuraiService without a constructor, right in the field declaration.