+ my-project-name works! +
+ `, + styles: [] +}) +export class MyProjectNameComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/templates/module/angular/projects/my-project-name/src/lib/my-project-name-routing.module.ts b/templates/module/angular/projects/my-project-name/src/lib/my-project-name-routing.module.ts new file mode 100644 index 0000000000..5ef00189aa --- /dev/null +++ b/templates/module/angular/projects/my-project-name/src/lib/my-project-name-routing.module.ts @@ -0,0 +1,20 @@ +import { AuthGuard, DynamicLayoutComponent, PermissionGuard } from '@abp/ng.core'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { MyProjectNameComponent } from './components/my-project-name.component'; + +const routes: Routes = [ + { + path: '', + component: DynamicLayoutComponent, + canActivate: [AuthGuard, PermissionGuard], + data: { requiredPolicy: '' }, + children: [{ path: '', component: MyProjectNameComponent }], + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class MyProjectNameRoutingModule {} diff --git a/templates/module/angular/projects/my-project-name/src/lib/my-project-name.module.ts b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.module.ts new file mode 100644 index 0000000000..a446b97bb5 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/src/lib/my-project-name.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { MyProjectNameComponent } from './components/my-project-name.component'; +import { MyProjectNameRoutingModule } from './my-project-name-routing.module'; +import { ThemeSharedModule } from '@abp/ng.theme.shared'; +import { CoreModule } from '@abp/ng.core'; + +@NgModule({ + declarations: [MyProjectNameComponent], + imports: [CoreModule, ThemeSharedModule, MyProjectNameRoutingModule], + exports: [MyProjectNameComponent], +}) +export class MyProjectNameModule {} diff --git a/templates/module/angular/projects/my-project-name/src/public-api.ts b/templates/module/angular/projects/my-project-name/src/public-api.ts new file mode 100644 index 0000000000..06a1e26fb3 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/src/public-api.ts @@ -0,0 +1,2 @@ +export * from './lib/components/my-project-name.component'; +export * from './lib/my-project-name.module'; diff --git a/templates/module/angular/projects/my-project-name/src/test.ts b/templates/module/angular/projects/my-project-name/src/test.ts new file mode 100644 index 0000000000..978c64fb83 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/src/test.ts @@ -0,0 +1,21 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/zone'; +import 'zone.js/dist/zone-testing'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +declare const require: any; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); diff --git a/templates/module/angular/projects/my-project-name/tsconfig.lib.json b/templates/module/angular/projects/my-project-name/tsconfig.lib.json new file mode 100644 index 0000000000..bd23948e59 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/tsconfig.lib.json @@ -0,0 +1,26 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/lib", + "target": "es2015", + "declaration": true, + "inlineSources": true, + "types": [], + "lib": [ + "dom", + "es2018" + ] + }, + "angularCompilerOptions": { + "annotateForClosureCompiler": true, + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true, + "enableResourceInlining": true + }, + "exclude": [ + "src/test.ts", + "**/*.spec.ts" + ] +} diff --git a/templates/module/angular/projects/my-project-name/tsconfig.spec.json b/templates/module/angular/projects/my-project-name/tsconfig.spec.json new file mode 100644 index 0000000000..16da33db07 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/tsconfig.spec.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "src/test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/templates/module/angular/projects/my-project-name/tslint.json b/templates/module/angular/projects/my-project-name/tslint.json new file mode 100644 index 0000000000..124133f849 --- /dev/null +++ b/templates/module/angular/projects/my-project-name/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "lib", + "camelCase" + ], + "component-selector": [ + true, + "element", + "lib", + "kebab-case" + ] + } +} diff --git a/templates/module/angular/src/app/app-routing.module.ts b/templates/module/angular/src/app/app-routing.module.ts new file mode 100644 index 0000000000..1714a2e06e --- /dev/null +++ b/templates/module/angular/src/app/app-routing.module.ts @@ -0,0 +1,43 @@ +import { ABP } from '@abp/ng.core'; +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; + +const routes: Routes = [ + { + path: '', + loadChildren: () => import('./home/home.module').then(m => m.HomeModule), + data: { + routes: { + name: '::Menu:Home', + } as ABP.Route, + }, + }, + { + path: 'identity', + loadChildren: () => import('./lazy-libs/identity-wrapper.module').then(m => m.IdentityWrapperModule), + }, + { + path: 'tenant-management', + loadChildren: () => + import('./lazy-libs/tenant-management-wrapper.module').then(m => m.TenantManagementWrapperModule), + }, + { + path: 'account', + loadChildren: () => import('./lazy-libs/account-wrapper.module').then(m => m.AccountWrapperModule), + }, + { + path: 'setting-management', + loadChildren: () => + import('./lazy-libs/setting-management-wrapper.module').then(m => m.SettingManagementWrapperModule), + }, + { + path: 'my-project-name', + loadChildren: () => import('./lazy-libs/my-project-name-wrapper.module').then(m => m.MyProjectNameWrapperModule), + }, +]; + +@NgModule({ + imports: [RouterModule.forRoot(routes)], + exports: [RouterModule], +}) +export class AppRoutingModule {} diff --git a/templates/module/angular/src/app/app.component.ts b/templates/module/angular/src/app/app.component.ts new file mode 100644 index 0000000000..bf2a27962a --- /dev/null +++ b/templates/module/angular/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + template: ` ++ {{ '::LongWelcomeMessage' | abpLocalization }} +
++ {{ 'AbpIdentity::Login' | abpLocalization }} +
+