Browse Source

feat: update template according to new config modules

pull/4455/head
Arman Ozak 6 years ago
parent
commit
fcc571ccdf
  1. 23
      templates/app/angular/src/app/app-routing.module.ts
  2. 20
      templates/app/angular/src/app/app.module.ts

23
templates/app/angular/src/app/app-routing.module.ts

@ -5,33 +5,36 @@ import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule), loadChildren: () => import('./home/home.module').then((m) => m.HomeModule),
data: { data: {
routes: { routes: {
name: '::Menu:Home' name: '::Menu:Home',
} as ABP.Route } as ABP.Route,
} },
}, },
{ {
path: 'account', path: 'account',
loadChildren: () => import('@abp/ng.account').then(m => m.AccountModule) loadChildren: () =>
import('@abp/ng.account').then((m) => m.AccountModule.forLazy({ redirectUrl: '/' })),
}, },
{ {
path: 'identity', path: 'identity',
loadChildren: () => import('@abp/ng.identity').then(m => m.IdentityModule) loadChildren: () => import('@abp/ng.identity').then((m) => m.IdentityModule.forLazy()),
}, },
{ {
path: 'tenant-management', path: 'tenant-management',
loadChildren: () => import('@abp/ng.tenant-management').then(m => m.TenantManagementModule) loadChildren: () =>
import('@abp/ng.tenant-management').then((m) => m.TenantManagementModule.forLazy()),
}, },
{ {
path: 'setting-management', path: 'setting-management',
loadChildren: () => import('@abp/ng.setting-management').then(m => m.SettingManagementModule) loadChildren: () =>
} import('@abp/ng.setting-management').then((m) => m.SettingManagementModule.forLazy()),
},
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes)], imports: [RouterModule.forRoot(routes)],
exports: [RouterModule] exports: [RouterModule],
}) })
export class AppRoutingModule {} export class AppRoutingModule {}

20
templates/app/angular/src/app/app.module.ts

@ -1,8 +1,9 @@
import { AccountConfigModule } from '@abp/ng.account.config'; import { AccountConfigModule } from '@abp/ng.account/config';
import { CoreModule } from '@abp/ng.core'; import { CoreModule } from '@abp/ng.core';
import { IdentityConfigModule } from '@abp/ng.identity.config'; import { IdentityConfigModule } from '@abp/ng.identity/config';
import { SettingManagementConfigModule } from '@abp/ng.setting-management.config'; import { SettingManagementConfigModule } from '@abp/ng.setting-management/config';
import { TenantManagementConfigModule } from '@abp/ng.tenant-management.config'; import { TenantManagementConfigModule } from '@abp/ng.tenant-management/config';
import { ThemeBasicModule } from '@abp/ng.theme.basic';
import { ThemeSharedModule } from '@abp/ng.theme.shared'; import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
@ -12,7 +13,6 @@ import { NgxsModule } from '@ngxs/store';
import { environment } from '../environments/environment'; import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module'; import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { SharedModule } from './shared/shared.module';
const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })]; const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];
@ -25,12 +25,12 @@ const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];
environment, environment,
}), }),
ThemeSharedModule.forRoot(), ThemeSharedModule.forRoot(),
AccountConfigModule.forRoot({ redirectUrl: '/' }), AccountConfigModule.forRoot(),
IdentityConfigModule, IdentityConfigModule.forRoot(),
TenantManagementConfigModule, TenantManagementConfigModule.forRoot(),
SettingManagementConfigModule, SettingManagementConfigModule.forRoot(),
NgxsModule.forRoot(), NgxsModule.forRoot(),
SharedModule, ThemeBasicModule.forRoot(),
...(environment.production ? [] : LOGGERS), ...(environment.production ? [] : LOGGERS),
], ],
declarations: [AppComponent], declarations: [AppComponent],

Loading…
Cancel
Save