import { Injectable } from "@angular/core" ; import { BaseRequestOptions , RequestOptions } from "@angular/http" ; import { AuthService } from "./AuthService" ; @ Injectable ( ) export class DefaultAuthService extends BaseRequestOptions { constructor ( private auth ) { super ( ) ; this . headers . set ( 'Authorization' , `Bearer 123` ) ; } } export const requestOptionsProvider = { provide : RequestOptions , useClass : DefaultAuthService } ;