Browse Source

Merge branch 'feature/migrating-abp-packages-to-standalone-structure' into feature/ssr-support

# Conflicts:
#	npm/ng-packs/packages/core/src/lib/core.module.ts
feature/ssr-migration-schematic
erdemcaygor 1 year ago
parent
commit
29b037ccd3
  1. 9
      npm/ng-packs/apps/dev-app/src/app/app.component.ts
  2. 13
      npm/ng-packs/apps/dev-app/src/app/app.routes.ts
  3. 2
      npm/ng-packs/packages/account/src/lib/account.routes.ts
  4. 2
      npm/ng-packs/packages/account/src/public-api.ts
  5. 1
      npm/ng-packs/packages/components/chart.js/src/chart.component.ts
  6. 5
      npm/ng-packs/packages/components/chart.js/src/chart.module.ts
  7. 1
      npm/ng-packs/packages/components/extensible/src/lib/directives/prop-data.directive.ts
  8. 1
      npm/ng-packs/packages/components/extensible/src/lib/pipes/create-injector.pipe.ts
  9. 28
      npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts
  10. 1
      npm/ng-packs/packages/components/tree/src/lib/templates/expanded-icon-template.directive.ts
  11. 1
      npm/ng-packs/packages/components/tree/src/lib/templates/tree-node-template.directive.ts
  12. 14
      npm/ng-packs/packages/components/tree/src/lib/tree.module.ts
  13. 1
      npm/ng-packs/packages/core/src/lib/directives/for.directive.ts
  14. 2
      npm/ng-packs/packages/identity/src/lib/identity.routes.ts
  15. 2
      npm/ng-packs/packages/identity/src/public-api.ts
  16. 35
      npm/ng-packs/packages/setting-management/config/src/lib/components/email-setting-group/email-setting-group.component.ts
  17. 7
      npm/ng-packs/packages/setting-management/config/src/lib/setting-management-config.module.ts
  18. 2
      npm/ng-packs/packages/setting-management/src/lib/setting-management.routes.ts
  19. 2
      npm/ng-packs/packages/setting-management/src/public-api.ts
  20. 4
      npm/ng-packs/packages/tenant-management/src/lib/tenant-management.routes.ts
  21. 2
      npm/ng-packs/packages/tenant-management/src/public-api.ts
  22. 1
      npm/ng-packs/packages/theme-shared/src/lib/components/spinner/spinner.component.ts
  23. 4
      templates/app-nolayers/angular/src/app/app.component.ts
  24. 54
      templates/app-nolayers/angular/src/app/app.config.ts
  25. 13
      templates/app-nolayers/angular/src/app/app.routes.ts
  26. 11
      templates/app-nolayers/angular/src/app/home/home-routing.module.ts
  27. 5
      templates/app-nolayers/angular/src/app/home/home.component.ts
  28. 10
      templates/app-nolayers/angular/src/app/home/home.module.ts
  29. 9
      templates/app-nolayers/angular/src/app/home/home.routes.ts
  30. 16
      templates/app-nolayers/angular/src/main.ts
  31. 4
      templates/app/angular/src/app/app.component.ts
  32. 46
      templates/app/angular/src/app/app.config.ts
  33. 56
      templates/app/angular/src/app/app.module.ts
  34. 13
      templates/app/angular/src/app/app.routes.ts
  35. 11
      templates/app/angular/src/app/home/home-routing.module.ts
  36. 5
      templates/app/angular/src/app/home/home.component.spec.ts
  37. 5
      templates/app/angular/src/app/home/home.component.ts
  38. 10
      templates/app/angular/src/app/home/home.module.ts
  39. 9
      templates/app/angular/src/app/home/home.routes.ts
  40. 16
      templates/app/angular/src/main.ts
  41. 6
      templates/module/angular/projects/dev-app/src/app/app.component.ts
  42. 46
      templates/module/angular/projects/dev-app/src/app/app.config.ts
  43. 15
      templates/module/angular/projects/dev-app/src/app/app.routes.ts
  44. 16
      templates/module/angular/projects/dev-app/src/app/home/home-routing.module.ts
  45. 1
      templates/module/angular/projects/dev-app/src/app/home/home.component.ts
  46. 10
      templates/module/angular/projects/dev-app/src/app/home/home.module.ts
  47. 9
      templates/module/angular/projects/dev-app/src/app/home/home.routes.ts
  48. 15
      templates/module/angular/projects/dev-app/src/main.ts
  49. 12
      templates/module/angular/projects/my-project-name/config/src/my-project-name-config.module.ts
  50. 1
      templates/module/angular/projects/my-project-name/src/lib/components/my-project-name.component.ts
  51. 23
      templates/module/angular/projects/my-project-name/src/lib/my-project-name.module.ts
  52. 11
      templates/module/angular/projects/my-project-name/src/lib/my-project-name.routes.ts
  53. 2
      templates/module/angular/projects/my-project-name/src/public-api.ts

9
npm/ng-packs/apps/dev-app/src/app/app.component.ts

@ -1,7 +1,6 @@
import { Component } from '@angular/core';
import { InternetConnectionStatusComponent, LoaderBarComponent } from '@abp/ng.theme.shared';
import { DynamicLayoutComponent } from '@abp/ng.core';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
@ -9,13 +8,7 @@ import { RouterOutlet } from '@angular/router';
<abp-loader-bar></abp-loader-bar>
<abp-dynamic-layout></abp-dynamic-layout>
<abp-internet-status></abp-internet-status>
<router-outlet />
`,
imports: [
LoaderBarComponent,
DynamicLayoutComponent,
InternetConnectionStatusComponent,
RouterOutlet,
],
imports: [LoaderBarComponent, DynamicLayoutComponent, InternetConnectionStatusComponent],
})
export class AppComponent {}

13
npm/ng-packs/apps/dev-app/src/app/app.routes.ts

@ -8,23 +8,18 @@ export const appRoutes: Routes = [
},
{
path: 'account',
loadChildren: () => import('@abp/ng.account').then(m => m.createAccountRoutingConfiguration()),
loadChildren: () => import('@abp/ng.account').then(m => m.createRoutes()),
},
{
path: 'identity',
loadChildren: () =>
import('@abp/ng.identity').then(m => m.createIdentityRoutingConfiguration()),
loadChildren: () => import('@abp/ng.identity').then(m => m.createRoutes()),
},
{
path: 'tenant-management',
loadChildren: () =>
import('@abp/ng.tenant-management').then(m => m.createTenantManagementRoutingConfiguration()),
loadChildren: () => import('@abp/ng.tenant-management').then(m => m.createRoutes()),
},
{
path: 'setting-management',
loadChildren: () =>
import('@abp/ng.setting-management').then(m =>
m.createSettingManagementRoutingConfiguration(),
),
loadChildren: () => import('@abp/ng.setting-management').then(m => m.createRoutes()),
},
];

2
npm/ng-packs/packages/account/src/lib/account.config.ts → npm/ng-packs/packages/account/src/lib/account.routes.ts

@ -44,7 +44,7 @@ export function provideAccount(options: AccountConfigOptions = {}) {
const canActivate = [authenticationFlowGuard];
export const createAccountRoutingConfiguration = (options: AccountConfigOptions = {}): Routes => [
export const createRoutes = (options: AccountConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,

2
npm/ng-packs/packages/account/src/public-api.ts

@ -7,4 +7,4 @@ export * from './lib/services';
export * from './lib/tokens';
export * from './lib/utils';
export * from './lib/resolvers';
export * from './lib/account.config';
export * from './lib/account.routes';

1
npm/ng-packs/packages/components/chart.js/src/chart.component.ts

@ -16,7 +16,6 @@ import {
let Chart: any;
@Component({
standalone: false,
selector: 'abp-chart',
template: `
<div

5
npm/ng-packs/packages/components/chart.js/src/chart.module.ts

@ -1,11 +1,10 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { ChartComponent } from './chart.component';
@NgModule({
imports: [CommonModule],
imports: [ChartComponent],
exports: [ChartComponent],
declarations: [ChartComponent],
declarations: [],
providers: [],
})
export class ChartModule {}

1
npm/ng-packs/packages/components/extensible/src/lib/directives/prop-data.directive.ts

@ -13,7 +13,6 @@ import { PropData, PropList } from '../models/props';
@Directive({
exportAs: 'abpPropData',
selector: '[abpPropData]',
standalone: true,
})
export class PropDataDirective<L extends PropList<any>>
extends PropData<InferredData<L>>

1
npm/ng-packs/packages/components/extensible/src/lib/pipes/create-injector.pipe.ts

@ -12,7 +12,6 @@ import { EXTENSIONS_ACTION_CALLBACK, EXTENSIONS_ACTION_DATA } from '../tokens/ex
@Pipe({
name: 'createInjector',
standalone: true,
})
export class CreateInjectorPipe<R> implements PipeTransform {
public transform(

28
npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts

@ -11,24 +11,44 @@ import {
TemplateRef,
ViewEncapsulation,
} from '@angular/core';
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/tree';
import { LazyLoadService, LOADING_STRATEGY, SubscriptionService } from '@abp/ng.core';
import { NgbDropdown, NgbDropdownMenu, NgbDropdownToggle } from '@ng-bootstrap/ng-bootstrap';
import {
NzFormatBeforeDropEvent,
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNode,
} from 'ng-zorro-antd/tree';
import {
InitDirective,
LazyLoadService,
LOADING_STRATEGY,
SubscriptionService,
} from '@abp/ng.core';
import { of } from 'rxjs';
import { DISABLE_TREE_STYLE_LOADING_TOKEN } from '../disable-tree-style-loading.token';
import { TreeNodeTemplateDirective } from '../templates/tree-node-template.directive';
import { ExpandedIconTemplateDirective } from '../templates/expanded-icon-template.directive';
import { CommonModule } from '@angular/common';
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
export type DropEvent = NzFormatEmitEvent & { pos: number };
@Component({
standalone: false,
selector: 'abp-tree',
templateUrl: 'tree.component.html',
styleUrls: ['tree.component.scss'],
encapsulation: ViewEncapsulation.None,
providers: [SubscriptionService],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
CommonModule,
NzTreeComponent,
NgbDropdown,
NgbDropdownMenu,
NgbDropdownToggle,
InitDirective,
NzNoAnimationDirective,
],
})
export class TreeComponent implements OnInit {
private lazyLoadService = inject(LazyLoadService);

1
npm/ng-packs/packages/components/tree/src/lib/templates/expanded-icon-template.directive.ts

@ -1,7 +1,6 @@
import { Directive, TemplateRef } from '@angular/core';
@Directive({
standalone: false,
selector: '[abpTreeExpandedIconTemplate],[abp-tree-expanded-icon-template]',
})
export class ExpandedIconTemplateDirective {

1
npm/ng-packs/packages/components/tree/src/lib/templates/tree-node-template.directive.ts

@ -1,7 +1,6 @@
import { Directive, TemplateRef } from '@angular/core';
@Directive({
standalone: false,
selector: '[abpTreeNodeTemplate],[abp-tree-node-template]',
})
export class TreeNodeTemplateDirective {

14
npm/ng-packs/packages/components/tree/src/lib/tree.module.ts

@ -1,19 +1,11 @@
import { CoreModule } from '@abp/ng.core';
import { NgModule } from '@angular/core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { TreeComponent } from './components/tree.component';
import { ExpandedIconTemplateDirective } from './templates/expanded-icon-template.directive';
import { TreeNodeTemplateDirective } from './templates/tree-node-template.directive';
const templates = [TreeNodeTemplateDirective, ExpandedIconTemplateDirective];
const exported = [...templates, TreeComponent];
@NgModule({
imports: [CoreModule, NzTreeModule, NgbDropdownModule, NzNoAnimationModule],
exports: [...exported],
declarations: [...exported],
imports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective],
exports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective],
declarations: [],
})
export class TreeModule {}

1
npm/ng-packs/packages/core/src/lib/directives/for.directive.ts

@ -33,7 +33,6 @@ class RecordView {
}
@Directive({
standalone: true,
selector: '[abpFor]',
})
export class ForDirective implements OnChanges {

2
npm/ng-packs/packages/identity/src/lib/identity.config.ts → npm/ng-packs/packages/identity/src/lib/identity.routes.ts

@ -44,7 +44,7 @@ export function provideIdentity(options: IdentityConfigOptions = {}): Provider[]
];
}
export const createIdentityRoutingConfiguration = (options: IdentityConfigOptions = {}): Routes => [
export const createRoutes = (options: IdentityConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,

2
npm/ng-packs/packages/identity/src/public-api.ts

@ -5,4 +5,4 @@ export * from './lib/identity.module';
export * from './lib/models';
export * from './lib/tokens';
export * from './lib/resolvers';
export * from './lib/identity.config';
export * from './lib/identity.routes';

35
npm/ng-packs/packages/setting-management/config/src/lib/components/email-setting-group/email-setting-group.component.ts

@ -1,21 +1,48 @@
import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
import { collapse, ToasterService } from '@abp/ng.theme.shared';
import {
ButtonComponent,
collapse,
ModalCloseDirective,
ModalComponent,
ToasterService,
} from '@abp/ng.theme.shared';
import { Component, inject, OnInit } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import {
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { finalize } from 'rxjs/operators';
import { SettingManagementPolicyNames } from '../../enums/policy-names';
import { EmailSettingsService } from '@abp/ng.setting-management/proxy';
import { EmailSettingsDto } from '../../proxy/models';
import { ConfigStateService, LocalizationService } from '@abp/ng.core';
import {
ConfigStateService,
LocalizationPipe,
LocalizationService,
PermissionDirective,
} from '@abp/ng.core';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { CommonModule } from '@angular/common';
const { required, email } = Validators;
@Component({
standalone: false,
selector: 'abp-email-setting-group',
templateUrl: 'email-setting-group.component.html',
animations: [collapse],
imports: [
ReactiveFormsModule,
CommonModule,
LocalizationPipe,
ButtonComponent,
ModalComponent,
ModalCloseDirective,
NgxValidateCoreModule,
PermissionDirective,
],
})
export class EmailSettingGroupComponent implements OnInit {
protected readonly localizationService = inject(LocalizationService);

7
npm/ng-packs/packages/setting-management/config/src/lib/setting-management-config.module.ts

@ -1,13 +1,10 @@
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { CoreModule } from '@abp/ng.core';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { EmailSettingGroupComponent } from './components/email-setting-group/email-setting-group.component';
import { provideSettingManagementConfig } from './providers';
@NgModule({
imports: [CoreModule, ThemeSharedModule, NgxValidateCoreModule],
declarations: [EmailSettingGroupComponent],
imports: [EmailSettingGroupComponent],
declarations: [],
exports: [EmailSettingGroupComponent],
})
export class SettingManagementConfigModule {

2
npm/ng-packs/packages/setting-management/src/lib/setting-management.config.ts → npm/ng-packs/packages/setting-management/src/lib/setting-management.routes.ts

@ -12,7 +12,7 @@ export function provideSettingManagement() {
return [];
}
export const createSettingManagementRoutingConfiguration = (): Routes => [
export const createRoutes = (): Routes => [
{
path: '',
component: RouterOutletComponent,

2
npm/ng-packs/packages/setting-management/src/public-api.ts

@ -1,4 +1,4 @@
export * from './lib/setting-management.module';
export * from './lib/components/setting-management.component';
export * from './lib/enums';
export * from './lib/setting-management.config';
export * from './lib/setting-management.routes';

4
npm/ng-packs/packages/tenant-management/src/lib/tenant-management.config.ts → npm/ng-packs/packages/tenant-management/src/lib/tenant-management.routes.ts

@ -44,9 +44,7 @@ export function provideTenantManagement(options: TenantManagementConfigOptions =
];
}
export const createTenantManagementRoutingConfiguration = (
options: TenantManagementConfigOptions = {},
): Routes => [
export const createRoutes = (options: TenantManagementConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,

2
npm/ng-packs/packages/tenant-management/src/public-api.ts

@ -5,4 +5,4 @@ export * from './lib/models';
export * from './lib/tenant-management.module';
export * from './lib/tokens';
export * from './lib/resolvers';
export * from './lib/tenant-management.config';
export * from './lib/tenant-management.routes';

1
npm/ng-packs/packages/theme-shared/src/lib/components/spinner/spinner.component.ts

@ -2,7 +2,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'abp-spinner',
standalone: true,
template: `
<div class="d-flex justify-content-center align-items-center border-top" style="height: 62px">
<div class="spinner-border" role="status" id="loading">

4
templates/app-nolayers/angular/src/app/app.component.ts

@ -1,12 +1,14 @@
import { Component } from '@angular/core';
import {InternetConnectionStatusComponent, LoaderBarComponent} from "@abp/ng.theme.shared";
import {DynamicLayoutComponent} from "@abp/ng.core";
@Component({
standalone: false,
selector: 'app-root',
template: `
<abp-loader-bar />
<abp-dynamic-layout />
<abp-internet-status />
`,
imports: [LoaderBarComponent, DynamicLayoutComponent, InternetConnectionStatusComponent]
})
export class AppComponent {}

54
templates/app-nolayers/angular/src/app/app.module.ts → templates/app-nolayers/angular/src/app/app.config.ts

@ -1,39 +1,24 @@
import { provideAccountConfig } from '@abp/ng.account/config';
import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core';
import {ApplicationConfig, importProvidersFrom} from '@angular/core';
import {provideAnimations} from "@angular/platform-browser/animations";
import {provideRouter} from "@angular/router";
import { appRoutes } from './app.routes';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { provideAbpCore, withOptions } from '@abp/ng.core';
import { environment } from '../environments/environment';
import { registerLocale } from '@abp/ng.core/locale';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideAbpThemeShared } from '@abp/ng.theme.shared';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import {
InternetConnectionStatusComponent,
ThemeSharedModule,
provideAbpThemeShared,
} from '@abp/ng.theme.shared';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
import {ThemeLeptonXModule} from "@abp/ng.theme.lepton-x";
import {SideMenuLayoutModule} from "@abp/ng.theme.lepton-x/layouts";
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
CoreModule,
ThemeSharedModule,
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
InternetConnectionStatusComponent,
],
declarations: [AppComponent],
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes),
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
@ -48,7 +33,10 @@ import { APP_ROUTE_PROVIDER } from './route.provider';
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
provideAnimations(),
importProvidersFrom([
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
])
],
bootstrap: [AppComponent],
})
export class AppModule {}
};

13
templates/app-nolayers/angular/src/app/app-routing.module.ts → templates/app-nolayers/angular/src/app/app.routes.ts

@ -1,11 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Routes } from '@angular/router';
const routes: Routes = [
export const appRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
loadChildren: () => import('./home/home.routes').then(m => m.homeRoutes),
},
{
path: 'account',
@ -26,9 +25,3 @@ const routes: Routes = [
import('@abp/ng.setting-management').then(m => m.SettingManagementModule.forLazy()),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}

11
templates/app-nolayers/angular/src/app/home/home-routing.module.ts

@ -1,11 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
const routes: Routes = [{ path: '', component: HomeComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomeRoutingModule {}

5
templates/app-nolayers/angular/src/app/home/home.component.ts

@ -1,11 +1,12 @@
import { AuthService } from '@abp/ng.core';
import {AuthService, LocalizationPipe} from '@abp/ng.core';
import { Component, inject } from '@angular/core';
import {CommonModule} from "@angular/common";
@Component({
standalone: false,
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
imports: [CommonModule, LocalizationPipe],
})
export class HomeComponent {
private authService = inject(AuthService);

10
templates/app-nolayers/angular/src/app/home/home.module.ts

@ -1,10 +0,0 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
@NgModule({
declarations: [HomeComponent],
imports: [SharedModule, HomeRoutingModule],
})
export class HomeModule {}

9
templates/app-nolayers/angular/src/app/home/home.routes.ts

@ -0,0 +1,9 @@
import { Routes } from '@angular/router';
export const homeRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadComponent: () => import('./home.component').then(m => m.HomeComponent),
},
];

16
templates/app-nolayers/angular/src/main.ts

@ -1,13 +1,5 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err));

4
templates/app/angular/src/app/app.component.ts

@ -1,12 +1,14 @@
import { Component } from '@angular/core';
import { InternetConnectionStatusComponent, LoaderBarComponent } from '@abp/ng.theme.shared';
import { DynamicLayoutComponent } from '@abp/ng.core';
@Component({
standalone: false,
selector: 'app-root',
template: `
<abp-loader-bar />
<abp-dynamic-layout />
<abp-internet-status />
`,
imports: [LoaderBarComponent, DynamicLayoutComponent, InternetConnectionStatusComponent],
})
export class AppComponent {}

46
templates/app/angular/src/app/app.config.ts

@ -0,0 +1,46 @@
import {ApplicationConfig, importProvidersFrom} from '@angular/core';
import { provideRouter } from '@angular/router';
import {provideAnimations} from "@angular/platform-browser/animations";
import { appRoutes } from './app.routes';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { provideAbpCore, withOptions } from '@abp/ng.core';
import { environment } from '../environments/environment';
import { registerLocale } from '@abp/ng.core/locale';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideAbpThemeShared } from '@abp/ng.theme.shared';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import {ThemeLeptonXModule} from "@abp/ng.theme.lepton-x";
import {SideMenuLayoutModule} from "@abp/ng.theme.lepton-x/layouts";
import {AccountLayoutModule} from "@abp/ng.theme.lepton-x/account";
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes),
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
environment,
registerLocaleFn: registerLocale(),
})
),
provideAbpOAuth(),
provideAbpThemeShared(),
provideSettingManagementConfig(),
provideAccountConfig(),
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
provideAnimations(),
provideAbpCore(),
importProvidersFrom([
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
AccountLayoutModule.forRoot(),
])
],
};

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

@ -1,56 +0,0 @@
import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core';
import { registerLocale } from '@abp/ng.core/locale';
import {
InternetConnectionStatusComponent,
ThemeSharedModule,
provideAbpThemeShared,
} from '@abp/ng.theme.shared';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
CoreModule,
ThemeSharedModule,
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
AccountLayoutModule.forRoot(),
InternetConnectionStatusComponent,
],
declarations: [AppComponent],
providers: [
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
environment,
registerLocaleFn: registerLocale(),
})
),
provideAbpOAuth(),
provideAbpThemeShared(),
provideSettingManagementConfig(),
provideAccountConfig(),
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
],
bootstrap: [AppComponent],
})
export class AppModule {}

13
templates/app/angular/src/app/app-routing.module.ts → templates/app/angular/src/app/app.routes.ts

@ -1,11 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Routes } from '@angular/router';
const routes: Routes = [
export const appRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
loadChildren: () => import('./home/home.routes').then(m => m.homeRoutes),
},
{
path: 'account',
@ -26,9 +25,3 @@ const routes: Routes = [
import('@abp/ng.setting-management').then(m => m.SettingManagementModule.forLazy()),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}

11
templates/app/angular/src/app/home/home-routing.module.ts

@ -1,11 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
const routes: Routes = [{ path: '', component: HomeComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomeRoutingModule {}

5
templates/app/angular/src/app/home/home.component.spec.ts

@ -6,8 +6,6 @@ import { HomeComponent } from "./home.component";
import { OAuthService } from 'angular-oauth2-oidc';
import { AuthService } from '@abp/ng.core';
describe("HomeComponent", () => {
let fixture: ComponentFixture<HomeComponent>;
const mockOAuthService = jasmine.createSpyObj('OAuthService', ['hasValidAccessToken'])
@ -15,11 +13,12 @@ describe("HomeComponent", () => {
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [HomeComponent],
declarations: [],
imports: [
CoreTestingModule.withConfig(),
ThemeSharedTestingModule.withConfig(),
NgxValidateCoreModule,
HomeComponent
],
providers: [
/* mock providers here */

5
templates/app/angular/src/app/home/home.component.ts

@ -1,11 +1,12 @@
import { AuthService } from '@abp/ng.core';
import {AuthService, LocalizationPipe} from '@abp/ng.core';
import { Component, inject } from '@angular/core';
import {CommonModule} from "@angular/common";
@Component({
standalone: false,
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss'],
imports: [CommonModule, LocalizationPipe]
})
export class HomeComponent {
private authService = inject(AuthService);

10
templates/app/angular/src/app/home/home.module.ts

@ -1,10 +0,0 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
@NgModule({
declarations: [HomeComponent],
imports: [SharedModule, HomeRoutingModule],
})
export class HomeModule {}

9
templates/app/angular/src/app/home/home.routes.ts

@ -0,0 +1,9 @@
import { Routes } from '@angular/router';
export const homeRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadComponent: () => import('./home.component').then(m => m.HomeComponent),
},
];

16
templates/app/angular/src/main.ts

@ -1,13 +1,5 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));
bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err));

6
templates/module/angular/projects/dev-app/src/app/app.component.ts

@ -1,11 +1,13 @@
import { Component } from '@angular/core';
import {LoaderBarComponent} from "@abp/ng.theme.shared";
import {DynamicLayoutComponent} from "@abp/ng.core";
@Component({
standalone: false,
selector: 'app-root',
template: `
<abp-loader-bar />
<abp-dynamic-layout />
<abp-dynamic-layout />,
`,
imports: [LoaderBarComponent, DynamicLayoutComponent]
})
export class AppComponent {}

46
templates/module/angular/projects/dev-app/src/app/app.module.ts → templates/module/angular/projects/dev-app/src/app/app.config.ts

@ -1,33 +1,24 @@
import { provideAccountConfig } from '@abp/ng.account/config';
import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core';
import {ApplicationConfig} from '@angular/core';
import {provideAnimations} from "@angular/platform-browser/animations";
import {provideRouter} from "@angular/router";
import { appRoutes } from './app.routes';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { provideAbpCore, withOptions } from '@abp/ng.core';
import { environment } from '../environments/environment';
import { registerLocale } from '@abp/ng.core/locale';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideAbpThemeShared } from '@abp/ng.theme.shared';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { ThemeBasicModule, provideThemeBasicConfig } from '@abp/ng.theme.basic';
import { ThemeSharedModule, provideAbpThemeShared } from '@abp/ng.theme.shared';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MyProjectNameConfigModule } from '@my-company-name/my-project-name/config';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
import {provideThemeBasicConfig} from "@abp/ng.theme.basic";
import {provideMyProjectNameConfig} from "@my-company-name/my-project-name/config";
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
CoreModule,
ThemeSharedModule,
MyProjectNameConfigModule.forRoot(),
ThemeBasicModule,
],
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes),
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
@ -44,9 +35,8 @@ import { APP_ROUTE_PROVIDER } from './route.provider';
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
provideAnimations(),
provideThemeBasicConfig(),
provideMyProjectNameConfig(),
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}
};

15
templates/module/angular/projects/dev-app/src/app/app-routing.module.ts → templates/module/angular/projects/dev-app/src/app/app.routes.ts

@ -1,11 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { Routes } from '@angular/router';
const routes: Routes = [
export const appRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
loadChildren: () => import('./home/home.routes').then(m => m.homeRoutes),
},
{
path: 'account',
@ -28,12 +27,6 @@ const routes: Routes = [
{
path: 'my-project-name',
loadChildren: () =>
import('@my-company-name/my-project-name').then(m => m.MyProjectNameModule.forLazy()),
import('@my-company-name/my-project-name').then(m => m.myProjectNameRoutes),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}

16
templates/module/angular/projects/dev-app/src/app/home/home-routing.module.ts

@ -1,16 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
const routes: Routes = [
{
path: '',
children: [{ path: '', component: HomeComponent }],
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomeRoutingModule {}

1
templates/module/angular/projects/dev-app/src/app/home/home.component.ts

@ -1,7 +1,6 @@
import { Component } from '@angular/core';
@Component({
standalone: false,
selector: 'app-home',
templateUrl: './home.component.html',
})

10
templates/module/angular/projects/dev-app/src/app/home/home.module.ts

@ -1,10 +0,0 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
@NgModule({
declarations: [HomeComponent],
imports: [SharedModule, HomeRoutingModule],
})
export class HomeModule {}

9
templates/module/angular/projects/dev-app/src/app/home/home.routes.ts

@ -0,0 +1,9 @@
import { Routes } from '@angular/router';
export const homeRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadComponent: () => import('./home.component').then(m => m.HomeComponent),
},
];

15
templates/module/angular/projects/dev-app/src/main.ts

@ -1,12 +1,5 @@
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err));

12
templates/module/angular/projects/my-project-name/config/src/my-project-name-config.module.ts

@ -1,12 +1,6 @@
import { ModuleWithProviders, NgModule } from '@angular/core';
import {makeEnvironmentProviders} from '@angular/core';
import { MY_PROJECT_NAME_ROUTE_PROVIDERS } from './providers/route.provider';
@NgModule()
export class MyProjectNameConfigModule {
static forRoot(): ModuleWithProviders<MyProjectNameConfigModule> {
return {
ngModule: MyProjectNameConfigModule,
providers: [MY_PROJECT_NAME_ROUTE_PROVIDERS],
};
}
export function provideMyProjectNameConfig() {
return makeEnvironmentProviders([MY_PROJECT_NAME_ROUTE_PROVIDERS])
}

1
templates/module/angular/projects/my-project-name/src/lib/components/my-project-name.component.ts

@ -2,7 +2,6 @@ import { Component, inject, OnInit } from '@angular/core';
import { MyProjectNameService } from '../services/my-project-name.service';
@Component({
standalone: false,
selector: 'lib-my-project-name',
template: ` <p>my-project-name works!</p> `,
styles: [],

23
templates/module/angular/projects/my-project-name/src/lib/my-project-name.module.ts

@ -1,23 +0,0 @@
import { NgModule, NgModuleFactory, ModuleWithProviders } from '@angular/core';
import { CoreModule, LazyModuleFactory } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { MyProjectNameComponent } from './components/my-project-name.component';
import { MyProjectNameRoutingModule } from './my-project-name-routing.module';
@NgModule({
declarations: [MyProjectNameComponent],
imports: [CoreModule, ThemeSharedModule, MyProjectNameRoutingModule],
exports: [MyProjectNameComponent],
})
export class MyProjectNameModule {
static forChild(): ModuleWithProviders<MyProjectNameModule> {
return {
ngModule: MyProjectNameModule,
providers: [],
};
}
static forLazy(): NgModuleFactory<MyProjectNameModule> {
return new LazyModuleFactory(MyProjectNameModule.forChild());
}
}

11
templates/module/angular/projects/my-project-name/src/lib/my-project-name-routing.module.ts → templates/module/angular/projects/my-project-name/src/lib/my-project-name.routes.ts

@ -1,9 +1,8 @@
import { NgModule } from '@angular/core';
import { RouterOutletComponent } from '@abp/ng.core';
import { Routes, RouterModule } from '@angular/router';
import { Routes } from '@angular/router';
import { MyProjectNameComponent } from './components/my-project-name.component';
const routes: Routes = [
export const myProjectNameRoutes: Routes = [
{
path: '',
pathMatch: 'full',
@ -16,9 +15,3 @@ const routes: Routes = [
],
},
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class MyProjectNameRoutingModule {}

2
templates/module/angular/projects/my-project-name/src/public-api.ts

@ -4,4 +4,4 @@
export * from './lib/components/my-project-name.component';
export * from './lib/services/my-project-name.service';
export * from './lib/my-project-name.module';
export * from './lib/my-project-name.routes';

Loading…
Cancel
Save