1- import { BrowserModule } from '@angular/platform-browser' ;
2- import { NgModule } from '@angular/core' ;
3- import { AppComponent } from './app.component' ;
4- import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
5- import { AppRoutingModule } from './app-routing.module' ;
6- import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
7- import { MessageModule } from './message/message.module' ;
8- import { DashboardModule } from './dashboard/dashboard.module' ;
9- import { HTTP_INTERCEPTORS , HttpClientModule } from '@angular/common/http' ;
10- import { V2Module } from './sega/chunithm/v2/v2.module' ;
11- import { DatabaseModule } from './database/database.module' ;
12- import { NgxPaginationModule } from 'ngx-pagination' ;
13- import { OngekiModule } from './sega/ongeki/ongeki.module' ;
14- import { Maimai2Module } from './sega/maimai2/maimai2.module' ;
15- import { ErrorInterceptorService } from './auth/error-interceptor.service' ;
16- import { LoadingInterceptorService } from './auth/loading-interceptor.service' ;
17- import { ImporterModule } from './importer/importer.module' ;
18- import { ServiceWorkerModule } from '@angular/service-worker' ;
19- import { environment } from '../environments/environment' ;
1+ import { BrowserModule } from '@angular/platform-browser' ;
2+ import { NgModule } from '@angular/core' ;
3+ import { AppComponent } from './app.component' ;
4+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
5+ import { AppRoutingModule } from './app-routing.module' ;
6+ import { FormsModule , ReactiveFormsModule } from '@angular/forms' ;
7+ import { MessageModule } from './message/message.module' ;
8+ import { DashboardModule } from './dashboard/dashboard.module' ;
9+ import { HTTP_INTERCEPTORS , HttpClientModule } from '@angular/common/http' ;
10+ import { V2Module } from './sega/chunithm/v2/v2.module' ;
11+ import { DatabaseModule } from './database/database.module' ;
12+ import { NgxPaginationModule } from 'ngx-pagination' ;
13+ import { OngekiModule } from './sega/ongeki/ongeki.module' ;
14+ import { Maimai2Module } from './sega/maimai2/maimai2.module' ;
15+ import { ErrorInterceptorService } from './auth/error-interceptor.service' ;
16+ import { LoadingInterceptorService } from './auth/loading-interceptor.service' ;
17+ import { ImporterModule } from './importer/importer.module' ;
18+ import { ServiceWorkerModule } from '@angular/service-worker' ;
19+ import { environment } from '../environments/environment' ;
2020import {
2121 Maimai2UploadUserPortraitDialog
2222} from './sega/maimai2/maimai2-setting/maimai2-upload-user-portrait/maimai2-upload-user-portrait.dialog' ;
2323
2424import Aegis from 'aegis-web-sdk' ;
25- import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
26- import { TokenInterceptorService } from './auth/token-interceptor.service' ;
27- import { NgIconsModule } from '@ng-icons/core' ;
28- import { HomeComponent } from './home/home.component' ;
29- import { ToastsContainer } from './toasts-container.component' ;
30- import { CardsComponent } from './cards/cards.component' ;
25+ import { NgbModule } from '@ng-bootstrap/ng-bootstrap' ;
26+ import { TokenInterceptorService } from './auth/token-interceptor.service' ;
27+ import { NgIconsModule } from '@ng-icons/core' ;
28+ import { HomeComponent } from './home/home.component' ;
29+ import { ToastsContainer } from './toasts-container.component' ;
30+ import { CardsComponent } from './cards/cards.component' ;
3131import {
3232 bootstrapChevronUp ,
3333 bootstrapChevronDown ,
@@ -62,6 +62,7 @@ import { LanguageService } from './language.service';
6262import { lastValueFrom } from 'rxjs' ;
6363import { KeychipComponent } from './keychip/keychip.component' ;
6464import { ClipboardModule } from '@angular/cdk/clipboard' ;
65+ import { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap' ;
6566import { OauthCallbackComponent } from './oauth-callback/oauth-callback.component' ;
6667import { SignInComponent } from './sign-in/sign-in.component' ;
6768import { SignUpComponent } from './sign-up/sign-up.component' ;
@@ -86,10 +87,10 @@ export function HttpLoaderFactory(http: HttpClient) {
8687export function initializeApp (
8788 translateService : TranslateService ,
8889 languageService : LanguageService ) {
89- return async ( ) => {
90- const userLang = languageService . getCurrentLang ( ) ;
91- await lastValueFrom ( translateService . use ( userLang ) ) ;
92- } ;
90+ return async ( ) => {
91+ const userLang = languageService . getCurrentLang ( ) ;
92+ await lastValueFrom ( translateService . use ( userLang ) ) ;
93+ } ;
9394}
9495
9596@NgModule ( {
@@ -109,7 +110,7 @@ export function initializeApp(
109110 AnnouncementsComponent ,
110111 EditComponent ,
111112 AdminComponent
112- ] ,
113+ ] ,
113114 imports : [
114115 BrowserModule ,
115116 BrowserAnimationsModule ,
@@ -127,7 +128,7 @@ export function initializeApp(
127128 Maimai2Module ,
128129
129130 ReactiveFormsModule ,
130- ServiceWorkerModule . register ( 'ngsw-worker.js' , { enabled : environment . production } ) ,
131+ ServiceWorkerModule . register ( 'ngsw-worker.js' , { enabled : environment . production } ) ,
131132 NgbModule ,
132133 FormsModule ,
133134 ToastsContainer ,
@@ -162,15 +163,16 @@ export function initializeApp(
162163 deps : [ HttpClient ] ,
163164 }
164165 } ) ,
165- ClipboardModule
166+ ClipboardModule ,
167+ NgbModule ,
166168 ] ,
167169 providers : [
168- { provide : HTTP_INTERCEPTORS , useClass : ErrorInterceptorService , multi : true } ,
169- { provide : HTTP_INTERCEPTORS , useClass : LoadingInterceptorService , multi : true } ,
170- { provide : HTTP_INTERCEPTORS , useClass : TokenInterceptorService , multi : true } ,
171- { provide : APP_INITIALIZER , useFactory : initializeApp , deps : [ TranslateService , LanguageService ] , multi : true } ,
170+ { provide : HTTP_INTERCEPTORS , useClass : ErrorInterceptorService , multi : true } ,
171+ { provide : HTTP_INTERCEPTORS , useClass : LoadingInterceptorService , multi : true } ,
172+ { provide : HTTP_INTERCEPTORS , useClass : TokenInterceptorService , multi : true } ,
173+ { provide : APP_INITIALIZER , useFactory : initializeApp , deps : [ TranslateService , LanguageService ] , multi : true } ,
172174 ] ,
173- bootstrap : [ AppComponent ]
175+ bootstrap : [ AppComponent ] ,
174176} )
175177export class AppModule {
176178}
0 commit comments