/** * @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'; import {global} from '../facade/lang'; let _nextRequestId = 0; export const JSONP_HOME = '__ng_jsonp__'; var _jsonpConnections: {[key: string]: any} = null; function _getJsonpConnections(): {[key: string]: any} { if (_jsonpConnections === null) { _jsonpConnections = (<{[key: string]: any}>global)[JSONP_HOME] = {}; } return _jsonpConnections; } // Make sure not to evaluate this in a non-browser environment! @Injectable() export class BrowserJsonp { // Construct a