What is the reason behind needing to include @Injectable
when performing Dependency Injection with http
, but not requiring it when implementing DI with a custom service?
Illustratively:
//no @Injectable() needed in this case
export class Test {
constructor(private customService: CustomService){}
}
/*-------------*/
@Injectable() // <== must be included here
export class HttpTest {
constructor(private http: Http){}
}