I just made two important updates to our Angular 4 applications and builds:
- @ angular / core
^4.1.3 => ^4.2.4 (and / http, / forms, etc.) - tslint
^5.3.2 => ^5.4.3
I have a Service that declares the following parameters:
@Injectable() export class WorkOrderService { private headers: Headers = new Headers({ 'Content-Type': 'application/json' }); private options: RequestOptions = new RequestOptions(this.headers); constructor(private http: Http) {} }
The above no longer checks tslint, causing the following error:
error TS2559: The Headers type has no common properties with the RequestOptionsArgs type.
The source (@ angular / http interface.d.ts:43 ) explicitly allows Headers as RequestOptionsArgs :
export interface RequestOptionsArgs { url?: string | null; method?: string | RequestMethod | null; search?: string | URLSearchParams | { [key: string]: any | any[]; } | null; params?: string | URLSearchParams | { [key: string]: any | any[]; } | null; headers?: Headers | null; body?: any; withCredentials?: boolean | null; responseType?: ResponseContentType | null; }
angular typescript
msanford Jun 23 '17 at 19:34 on 2017-06-23 19:34
source share