74 lines
2.3 KiB
TypeScript
74 lines
2.3 KiB
TypeScript
import { NgModule } from '@angular/core';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
|
|
import { HttpClientModule } from '@angular/common/http';
|
|
|
|
import { CookieService } from 'ngx-cookie-service';
|
|
|
|
import { MemberModule } from 'packages/member/member.module';
|
|
|
|
import { RPCClient } from 'packages/core/rpc/client/RPCClient';
|
|
import { RPCClientCodec } from 'packages/core/rpc/protocol/RPCClientCodec';
|
|
import { RPCClientJSONCodec } from 'packages/core/rpc/protocol/json/RPCClientJSONCodec';
|
|
|
|
import { RPCClientRWC } from 'packages/core/rpc/client/rwc/RPCClientRWC';
|
|
import { RPCClientWebsocketRWC } from 'packages/core/rpc/client/rwc/websocket/RPCClientWebsocketRWC';
|
|
import { RxWebsocketSubjectConfig } from 'packages/core/websocket/RxWebsocketSubject';
|
|
|
|
import { RESTClient } from 'packages/core/rest/client/RESTClient';
|
|
|
|
import { AppRoutingModule } from './app-routing.module';
|
|
import { AppStoreModule } from './app-store.module';
|
|
import { AppL10NModule } from './app-l10n.module';
|
|
|
|
import { MaterialModule } from './commons/ui/material/material.module';
|
|
import { CovalentModule } from './commons/ui/covalent/covalent.module';
|
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { environment } from '../environments/environment';
|
|
import { RPCService } from './commons/service/rpc.service';
|
|
import { RESTService } from './commons/service/rest.service';
|
|
import { AuthGuard } from './commons/guard/auth.guard';
|
|
|
|
|
|
@NgModule({
|
|
imports: [
|
|
BrowserModule,
|
|
BrowserAnimationsModule,
|
|
AppRoutingModule,
|
|
AppStoreModule,
|
|
AppL10NModule,
|
|
MaterialModule,
|
|
CovalentModule,
|
|
HttpClientModule,
|
|
MemberModule,
|
|
],
|
|
providers: [
|
|
{provide: 'REST_BASE_URL', useValue: environment.restBaseURL},
|
|
{provide: 'WEBAPP_RPC_CONFIG', useValue: environment.webappRPCConfig},
|
|
|
|
{provide: RPCClientCodec, useFactory: () => new RPCClientJSONCodec()},
|
|
{
|
|
provide: RPCClientRWC,
|
|
useFactory: (config: RxWebsocketSubjectConfig) => new RPCClientWebsocketRWC(config),
|
|
deps: ['WEBAPP_RPC_CONFIG']
|
|
},
|
|
{
|
|
provide: RESTClient, useClass: RESTService
|
|
},
|
|
{
|
|
provide: RPCClient, useClass: RPCService
|
|
},
|
|
CookieService,
|
|
AuthGuard,
|
|
],
|
|
declarations: [
|
|
AppComponent,
|
|
],
|
|
bootstrap: [AppComponent]
|
|
})
|
|
export class AppModule { }
|