mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 19:53:43 +00:00
[SM-44] Lazy loaded import and exporters (#2918)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
|
||||
import { ExportComponent } from "./export.component";
|
||||
import { ImportComponent } from "./import.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: "import",
|
||||
component: ImportComponent,
|
||||
data: { titleId: "importData" },
|
||||
},
|
||||
{
|
||||
path: "export",
|
||||
component: ExportComponent,
|
||||
data: { titleId: "exportVault" },
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
})
|
||||
export class ImportExportRoutingModule {}
|
||||
48
apps/web/src/app/tools/import-export/import-export.module.ts
Normal file
48
apps/web/src/app/tools/import-export/import-export.module.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { NgModule } from "@angular/core";
|
||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { CipherService } from "@bitwarden/common/abstractions/cipher.service";
|
||||
import { CollectionService } from "@bitwarden/common/abstractions/collection.service";
|
||||
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
|
||||
import { FolderService } from "@bitwarden/common/abstractions/folder.service";
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { ImportService as ImportServiceAbstraction } from "@bitwarden/common/abstractions/import.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
|
||||
import { ImportService } from "@bitwarden/common/services/import.service";
|
||||
|
||||
import { LooseComponentsModule } from "../../modules/loose-components.module";
|
||||
|
||||
import { ExportComponent } from "./export.component";
|
||||
import { ImportExportRoutingModule } from "./import-export-routing.module";
|
||||
import { ImportComponent } from "./import.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
JslibModule,
|
||||
LooseComponentsModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
ImportExportRoutingModule,
|
||||
],
|
||||
declarations: [ImportComponent, ExportComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: ImportServiceAbstraction,
|
||||
useClass: ImportService,
|
||||
deps: [
|
||||
CipherService,
|
||||
FolderService,
|
||||
ApiService,
|
||||
I18nService,
|
||||
CollectionService,
|
||||
PlatformUtilsService,
|
||||
CryptoService,
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
export class ImportExportModule {}
|
||||
Reference in New Issue
Block a user