Angular - Services and Dependency Injection
What is wrong with this service usage in a component?
@Injectable({ providedIn: 'root' })
export class DataService {
data = [];
}
@Component({ selector: 'app-test', template: '' })
export class TestComponent {
dataService: DataService;
constructor(private dataService: DataService) {
}
}