forked from NativeScript/nativescript-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.ts
More file actions
35 lines (30 loc) · 897 Bytes
/
http.ts
File metadata and controls
35 lines (30 loc) · 897 Bytes
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
import {
Http, XHRBackend, RequestOptions
} from "@angular/http";
import { NSXSRFStrategy, NSHttp } from "./http/ns-http";
import { NSFileSystem } from "./file-system/ns-file-system";
import { NgModule } from "@angular/core";
import { HttpModule, XSRFStrategy } from "@angular/http";
export { NSHttp } from "./http/ns-http";
export function nsHttpFactory(backend, options, nsFileSystem) {
return new NSHttp(backend, options, nsFileSystem);
}
export function nsXSRFStrategyFactory() {
return new NSXSRFStrategy();
}
@NgModule({
providers: [
{provide: XSRFStrategy, useFactory: nsXSRFStrategyFactory},
NSFileSystem,
{provide: Http, useFactory: nsHttpFactory,
deps: [XHRBackend, RequestOptions, NSFileSystem]}
],
imports: [
HttpModule,
],
exports: [
HttpModule,
]
})
export class NativeScriptHttpModule {
}