http_module.js
3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
* @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 { NgModule } from '@angular/core';
import { BrowserJsonp } from './backends/browser_jsonp';
import { BrowserXhr } from './backends/browser_xhr';
import { JSONPBackend, JSONPBackend_ } from './backends/jsonp_backend';
import { CookieXSRFStrategy, XHRBackend } from './backends/xhr_backend';
import { BaseRequestOptions, RequestOptions } from './base_request_options';
import { BaseResponseOptions, ResponseOptions } from './base_response_options';
import { Http, Jsonp } from './http';
import { XSRFStrategy } from './interfaces';
/**
* @return {?}
*/
export function _createDefaultCookieXSRFStrategy() {
return new CookieXSRFStrategy();
}
/**
* @param {?} xhrBackend
* @param {?} requestOptions
* @return {?}
*/
export function httpFactory(xhrBackend, requestOptions) {
return new Http(xhrBackend, requestOptions);
}
/**
* @param {?} jsonpBackend
* @param {?} requestOptions
* @return {?}
*/
export function jsonpFactory(jsonpBackend, requestOptions) {
return new Jsonp(jsonpBackend, requestOptions);
}
/**
* The module that includes http's providers
*
* \@experimental
*/
export var HttpModule = (function () {
function HttpModule() {
}
HttpModule.decorators = [
{ type: NgModule, args: [{
providers: [
// TODO(pascal): use factory type annotations once supported in DI
// issue: https://github.com/angular/angular/issues/3183
{ provide: Http, useFactory: httpFactory, deps: [XHRBackend, RequestOptions] },
BrowserXhr,
{ provide: RequestOptions, useClass: BaseRequestOptions },
{ provide: ResponseOptions, useClass: BaseResponseOptions },
XHRBackend,
{ provide: XSRFStrategy, useFactory: _createDefaultCookieXSRFStrategy },
],
},] },
];
/** @nocollapse */
HttpModule.ctorParameters = function () { return []; };
return HttpModule;
}());
function HttpModule_tsickle_Closure_declarations() {
/** @type {?} */
HttpModule.decorators;
/**
* @nocollapse
* @type {?}
*/
HttpModule.ctorParameters;
}
/**
* The module that includes jsonp's providers
*
* \@experimental
*/
export var JsonpModule = (function () {
function JsonpModule() {
}
JsonpModule.decorators = [
{ type: NgModule, args: [{
providers: [
// TODO(pascal): use factory type annotations once supported in DI
// issue: https://github.com/angular/angular/issues/3183
{ provide: Jsonp, useFactory: jsonpFactory, deps: [JSONPBackend, RequestOptions] },
BrowserJsonp,
{ provide: RequestOptions, useClass: BaseRequestOptions },
{ provide: ResponseOptions, useClass: BaseResponseOptions },
{ provide: JSONPBackend, useClass: JSONPBackend_ },
],
},] },
];
/** @nocollapse */
JsonpModule.ctorParameters = function () { return []; };
return JsonpModule;
}());
function JsonpModule_tsickle_Closure_declarations() {
/** @type {?} */
JsonpModule.decorators;
/**
* @nocollapse
* @type {?}
*/
JsonpModule.ctorParameters;
}
//# sourceMappingURL=http_module.js.map