fix(http): Update types for TypeScript nullability support

This commit is contained in:
Miško Hevery
2017-03-24 09:55:16 -07:00
committed by Tobias Bosch
parent 86396a43e9
commit c36ec9bf60
18 changed files with 138 additions and 128 deletions

View File

@ -10,7 +10,7 @@ import {Injectable} from '@angular/core';
let _nextRequestId = 0;
export const JSONP_HOME = '__ng_jsonp__';
let _jsonpConnections: {[key: string]: any} = null;
let _jsonpConnections: {[key: string]: any}|null = null;
function _getJsonpConnections(): {[key: string]: any} {
const w: {[key: string]: any} = typeof window == 'object' ? window : {};

View File

@ -115,7 +115,7 @@ export class XHRConnection implements Connection {
if (!req.headers.has('Accept')) {
req.headers.append('Accept', 'application/json, text/plain, */*');
}
req.headers.forEach((values, name) => _xhr.setRequestHeader(name, values.join(',')));
req.headers.forEach((values, name) => _xhr.setRequestHeader(name !, values.join(',')));
// Select the correct buffer type to store the response
if (req.responseType != null && _xhr.responseType != null) {