I'm struggling to understand this issue. I've created a custom class that extends Angular's Http class.
import { Injectable } from '@angular/core';
{
Http,
ConnectionBackend,
RequestOptions,
RequestOptionsArgs,
Request, Response
} from '@angular/http';
This class is called HttpService
, and I inject it into another class.
import { HttpService } from './http.service';
{ Injectable } from '@angular/core';
@Injectable()
export class KateService {
constructor(private $http: HttpService) {
}
}
During debugging, I noticed that the $oauth: OAuth
property in my HttpService
class is null, even though I expected it to be injected. It seems like only the two default parameters (connectionBackend and defaultOptions) are being injected by the calling method, leaving out my custom OAuth service.
It appears that Angular2 is treating my custom Http service as if it were a built-in service. Being new to Angular2, I may need some guidance on how to resolve this issue.