Browse Source

feature(template): implement config modules

pull/1810/head
mehmet-erim 7 years ago
parent
commit
6bc33f0ab4
  1. 2
      npm/ng-packs/packages/core/src/lib/plugins/config/config.plugin.ts
  2. 10
      templates/app/angular/src/app/app-routing.module.ts
  3. 11
      templates/app/angular/src/app/app.module.ts

2
npm/ng-packs/packages/core/src/lib/plugins/config/config.plugin.ts

@ -56,7 +56,7 @@ function transformRoutes(routes: Routes = [], wrappers: ABP.FullRoute[] = []): a
routes
.filter(route => route.component || route.loadChildren)
.forEach(route => {
const abpPackage = ABP_ROUTES.find(abp => abp.path.toLowerCase() === route.path.toLowerCase());
const abpPackage = ABP_ROUTES.find(abp => abp.path.toLowerCase() === route.path.toLowerCase() && !abp.wrapper);
const { length } = transformed;

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

@ -1,9 +1,6 @@
import { IDENTITY_ROUTES } from '@abp/ng.identity';
import { ACCOUNT_ROUTES } from '@abp/ng.account';
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ABP } from '@abp/ng.core';
import { TENANT_MANAGEMENT_ROUTES } from '@abp/ng.tenant-management';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
@ -18,18 +15,15 @@ const routes: Routes = [
{
path: 'account',
loadChildren: () => import('./lazy-libs/account-wrapper.module').then(m => m.AccountWrapperModule),
data: { routes: ACCOUNT_ROUTES },
},
{
path: 'identity',
loadChildren: () => import('./lazy-libs/identity-wrapper.module').then(m => m.IdentityWrapperModule),
data: { routes: IDENTITY_ROUTES },
},
{
path: 'tenant-management',
loadChildren: () =>
import('./lazy-libs/tenant-management-wrapper.module').then(m => m.TenantManagementWrapperModule),
data: { routes: TENANT_MANAGEMENT_ROUTES },
},
];

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

@ -11,9 +11,9 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SharedModule } from './shared/shared.module';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { AccountProviders } from '@abp/ng.account';
import { IdentityProviders } from '@abp/ng.identity';
import { TenantManagementProviders } from '@abp/ng.tenant-management';
import { AccountConfigModule } from '@abp/ng.account.config';
import { IdentityConfigModule } from '@abp/ng.identity.config';
import { TenantManagementConfigModule } from '@abp/ng.tenant-management.config';
@NgModule({
declarations: [AppComponent],
@ -27,13 +27,16 @@ import { TenantManagementProviders } from '@abp/ng.tenant-management';
}),
OAuthModule.forRoot(),
NgxsModule.forRoot([]),
AccountConfigModule.forRoot({ redirectUrl: '/' }),
IdentityConfigModule,
TenantManagementConfigModule,
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
SharedModule,
NgxsReduxDevtoolsPluginModule.forRoot({ disabled: environment.production }),
],
providers: [...AccountProviders({ redirectUrl: '/' }), ...IdentityProviders(), ...TenantManagementProviders()],
bootstrap: [AppComponent],
})
export class AppModule {}

Loading…
Cancel
Save