-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathindex.ts
More file actions
67 lines (63 loc) · 2.45 KB
/
index.ts
File metadata and controls
67 lines (63 loc) · 2.45 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
import {ModuleWithProviders, NgModule} from '@angular/core';
import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from '@angular/common/http';
import {HalParam, RestService} from './src/rest.service';
import {ExternalService} from './src/external.service';
import {ResourceService} from './src/resource.service';
import {ExternalConfigurationHandlerInterface} from './src/external-configuration.handler';
import 'rxjs';
import {SubTypeBuilder} from './src/subtype-builder';
import {AuthInterceptor} from "./src/interceptor/AuthInterceptor";
import {TokenConfig} from "./src/TokenConfig";
import {TokenConfigService} from "./src/interceptor/TokenConfigService";
export {ExternalService} from './src/external.service';
export {RestService} from './src/rest.service';
export {Resource} from './src/resource';
export {ResourceArray} from './src/resource-array';
export {Sort} from './src/sort';
export {ResourceHelper} from './src/resource-helper';
export {CacheHelper} from './src/cache/cache.helper';
export {EvictStrategy} from './src/cache/cache.helper';
export {ResourceExpire} from './src/cache/cache.helper';
export {ExternalConfiguration} from './src/ExternalConfiguration';
export {ExternalConfigurationHandlerInterface} from './src/external-configuration.handler';
export {HalOptions, HalParam} from "./src/rest.service";
export {SubTypeBuilder} from "./src/subtype-builder";
@NgModule({
imports: [HttpClientModule],
declarations: [],
exports: [HttpClientModule],
providers: [
ExternalService,
HttpClient,
{
provide: ResourceService,
useClass: ResourceService,
deps: [ExternalService]
}]
})
export class AngularHalModule {
static forRoot(tokenConfig?: TokenConfig): ModuleWithProviders {
return {
ngModule: AngularHalModule,
providers: [
ExternalService,
HttpClient,
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true,
deps: [TokenConfigService]
},
{
provide: TokenConfigService,
useValue: tokenConfig == null ? '' : tokenConfig
},
{
provide: ResourceService,
useClass: ResourceService,
deps: [ExternalService]
}
]
};
}
}