/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Injectable} from '@angular/core'; let _nextRequestId = 0; export const JSONP_HOME = '__ng_jsonp__'; let _jsonpConnections: {[key: string]: any} = null; function _getJsonpConnections(): {[key: string]: any} { const w: {[key: string]: any} = typeof window == 'object' ? window : {}; if (_jsonpConnections === null) { _jsonpConnections = w[JSONP_HOME] = {}; } return _jsonpConnections; } // Make sure not to evaluate this in a non-browser environment! @Injectable() export class BrowserJsonp { // Construct a