I am trying to build an application with Angular 6 and I am still setting everything up. But it seems there is something wrong with the dependency injection in my app.
@Inject did the trick for me
import {Component, Inject} from '@angular/core';
import {TestService} from "./TestService";
@Component({
selector: 'sh-home',
styleUrls: ['./home.scss'],
templateUrl: './home.html'
})
export class HomeComponent {
constructor(@Inject(TestService) testService: TestService) {
testService.sayHello();
}
}