diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000..cb1ba99
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,7 @@
+{
+ "singleQuote": true,
+ "useTabs": false,
+ "tabWidth": 2,
+ "printWidth": 80,
+ "trailingComma": "none"
+}
diff --git a/package-lock.json b/package-lock.json
index bc03a82..a65d55b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1543,6 +1543,11 @@
"semver-intersect": "1.4.0"
}
},
+ "@siemplify/utils": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/@siemplify/utils/-/utils-1.5.2.tgz",
+ "integrity": "sha512-sfnzRgUnW7K1kP0FmGWL6+KRErShDJFwwbXjK386JaRLYeIjIPxoeJrS0jAOjxAAAWvc1cKY9QauZ4u/0lDENw=="
+ },
"@types/events": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz",
@@ -6492,6 +6497,11 @@
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
+ "lodash-es": {
+ "version": "4.17.15",
+ "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz",
+ "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ=="
+ },
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
@@ -7953,6 +7963,12 @@
"integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=",
"dev": true
},
+ "prettier": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz",
+ "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==",
+ "dev": true
+ },
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
@@ -10162,6 +10178,12 @@
}
}
},
+ "tslint-config-prettier": {
+ "version": "1.18.0",
+ "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz",
+ "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==",
+ "dev": true
+ },
"tsutils": {
"version": "2.29.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
diff --git a/package.json b/package.json
index 1a414e6..c3fe37b 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
- "start": "ng serve",
+ "start": "ng serve --o --port=4211",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
@@ -19,6 +19,8 @@
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
+ "@siemplify/utils": "1.5.2",
+ "lodash-es": "4.17.15",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
@@ -28,9 +30,9 @@
"@angular/cli": "~8.3.22",
"@angular/compiler-cli": "~8.2.14",
"@angular/language-service": "~8.2.14",
- "@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
+ "@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
@@ -39,9 +41,11 @@
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
+ "prettier": "2.0.5",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
+ "tslint-config-prettier": "1.18.0",
"typescript": "~3.5.3"
}
}
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 06c7342..9dc239a 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -1,11 +1,26 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
-
-const routes: Routes = [];
+const routes: Routes = [
+ {
+ path: 'users',
+ loadChildren: () =>
+ import('./users/users.module').then((m) => m.UsersModule),
+ },
+ {
+ path: 'settings',
+ loadChildren: () =>
+ import('./settings/settings.module').then((m) => m.SettingsModule),
+ },
+ {
+ path: 'todos',
+ loadChildren: () =>
+ import('./todos/todos.module').then((m) => m.TodosModule),
+ },
+];
@NgModule({
- imports: [RouterModule.forRoot(routes)],
- exports: [RouterModule]
+ imports: [RouterModule.forRoot(routes, { useHash: true })],
+ exports: [RouterModule],
})
-export class AppRoutingModule { }
+export class AppRoutingModule {}
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 7feacad..f6bd170 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1,538 +1,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ title }} app is running!
-
-
-
-
-
-
-
Resources
-
Here are some links to help you get started:
-
-
-
-
-
Next Steps
-
What do you want to do next with your app?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Run and Watch Tests
-
-
-
-
-
-
Build for Production
-
-
-
-
-
-
ng generate component xyz
-
ng add @angular/material
-
ng add _____
-
ng test
-
ng build --prod
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+Url pipe
+{{ route | moduleUrl: (extras | parse): {queryParams: (navExtras | parse)} }}
+Link
+Link
+
+
diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts
deleted file mode 100644
index 83186f2..0000000
--- a/src/app/app.component.spec.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-import { TestBed, async } from '@angular/core/testing';
-import { RouterTestingModule } from '@angular/router/testing';
-import { AppComponent } from './app.component';
-
-describe('AppComponent', () => {
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- imports: [
- RouterTestingModule
- ],
- declarations: [
- AppComponent
- ],
- }).compileComponents();
- }));
-
- it('should create the app', () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.debugElement.componentInstance;
- expect(app).toBeTruthy();
- });
-
- it(`should have as title 'navigation'`, () => {
- const fixture = TestBed.createComponent(AppComponent);
- const app = fixture.debugElement.componentInstance;
- expect(app.title).toEqual('navigation');
- });
-
- it('should render title', () => {
- const fixture = TestBed.createComponent(AppComponent);
- fixture.detectChanges();
- const compiled = fixture.debugElement.nativeElement;
- expect(compiled.querySelector('.content span').textContent).toContain('navigation app is running!');
- });
-});
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 2f0ec21..256082a 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -6,5 +6,7 @@ import { Component } from '@angular/core';
styleUrls: ['./app.component.scss']
})
export class AppComponent {
- title = 'navigation';
+ route = '';
+ extras = '[]';
+ navExtras = '[]';
}
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 2c3ba29..4bc27b0 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -1,18 +1,20 @@
-import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
-
+import { FormsModule } from '@angular/forms';
+import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
+import { NavigationModule } from './navigation/navigation.module';
+import { ParsePipe } from './parse.pipe';
@NgModule({
- declarations: [
- AppComponent
- ],
+ declarations: [AppComponent, ParsePipe],
imports: [
BrowserModule,
- AppRoutingModule
+ AppRoutingModule,
+ FormsModule,
+ NavigationModule.forRoot({ baseRoute: null })
],
providers: [],
bootstrap: [AppComponent]
})
-export class AppModule { }
+export class AppModule {}
diff --git a/src/app/navigation/config.ts b/src/app/navigation/config.ts
new file mode 100644
index 0000000..c49a9bf
--- /dev/null
+++ b/src/app/navigation/config.ts
@@ -0,0 +1,34 @@
+import { InjectionToken } from '@angular/core';
+import { NavigationExtras } from '@angular/router';
+
+export const NAVIGATION_CONFIG = new InjectionToken('NavigationConfig');
+
+export interface NavigationConfig {
+ baseRoute?: string;
+}
+
+export interface NavigationRouteConfig {
+ extras?: any[];
+ navExtras?: NavigationExtras;
+ withBase?: boolean;
+}
+
+export function mergeConfig(
+ config: Partial
+): NavigationConfig {
+ return {
+ baseRoute: 'main',
+ ...config
+ };
+}
+
+export function mergeNavConfig(
+ config: Partial
+): NavigationRouteConfig {
+ return {
+ extras: [],
+ navExtras: {},
+ withBase: true,
+ ...config
+ };
+}
diff --git a/src/app/navigation/module-route.pipe.ts b/src/app/navigation/module-route.pipe.ts
new file mode 100644
index 0000000..b822764
--- /dev/null
+++ b/src/app/navigation/module-route.pipe.ts
@@ -0,0 +1,17 @@
+import { Pipe, PipeTransform } from '@angular/core';
+import { UrlTree } from '@angular/router';
+import { NavigationService } from './navigation.service';
+
+@Pipe({
+ name: 'moduleRoute'
+})
+export class ModuleRoutePipe implements PipeTransform {
+ constructor(private service: NavigationService) {}
+
+ transform(module: string, extras: any[] = []): any[] | undefined {
+ if (!module) {
+ return undefined;
+ }
+ return this.service.getModuleRoute(module, extras);
+ }
+}
diff --git a/src/app/navigation/module-url.pipe.ts b/src/app/navigation/module-url.pipe.ts
new file mode 100644
index 0000000..5891f93
--- /dev/null
+++ b/src/app/navigation/module-url.pipe.ts
@@ -0,0 +1,21 @@
+import { Pipe, PipeTransform } from '@angular/core';
+import { NavigationExtras } from '@angular/router';
+import { NavigationService } from './navigation.service';
+
+@Pipe({
+ name: 'moduleUrl'
+})
+export class ModuleUrlPipe implements PipeTransform {
+ constructor(private service: NavigationService) {}
+
+ transform(
+ module: string,
+ extras: any[] = [],
+ navExtras: NavigationExtras = {}
+ ): any {
+ if (!module) {
+ return module;
+ }
+ return this.service.getModuleUrl(module, { extras, navExtras });
+ }
+}
diff --git a/src/app/navigation/navigation.module.ts b/src/app/navigation/navigation.module.ts
new file mode 100644
index 0000000..5808691
--- /dev/null
+++ b/src/app/navigation/navigation.module.ts
@@ -0,0 +1,41 @@
+import { ModuleWithProviders, NgModule } from '@angular/core';
+import { mergeConfig, NAVIGATION_CONFIG, NavigationConfig } from './config';
+import { ModuleRoutePipe } from './module-route.pipe';
+import { ModuleUrlPipe } from './module-url.pipe';
+import { NavigationService } from './navigation.service';
+
+const SHARED = [ModuleRoutePipe, ModuleUrlPipe];
+
+@NgModule({
+ declarations: [...SHARED],
+ exports: [...SHARED]
+})
+export class NavigationModule {
+ constructor(service: NavigationService) {}
+
+ static forRoot(config: Partial = {}): ModuleWithProviders {
+ return {
+ ngModule: NavigationModule,
+ providers: [
+ NavigationService,
+ {
+ provide: NAVIGATION_CONFIG,
+ useValue: mergeConfig(config)
+ }
+ ]
+ };
+ }
+
+ static forChild(config: Partial = {}): ModuleWithProviders {
+ return {
+ ngModule: NavigationModule,
+ providers: [
+ NavigationService,
+ {
+ provide: NAVIGATION_CONFIG,
+ useValue: mergeConfig(config)
+ }
+ ]
+ };
+ }
+}
diff --git a/src/app/navigation/navigation.service.ts b/src/app/navigation/navigation.service.ts
new file mode 100644
index 0000000..a996e3b
--- /dev/null
+++ b/src/app/navigation/navigation.service.ts
@@ -0,0 +1,82 @@
+import { Inject, Injectable } from '@angular/core';
+import { ExtraOptions, Router, ROUTER_CONFIGURATION } from '@angular/router';
+import { toBoolean } from '@siemplify/utils';
+import {
+ mergeNavConfig,
+ NAVIGATION_CONFIG,
+ NavigationConfig,
+ NavigationRouteConfig
+} from './config';
+
+let service: NavigationService;
+
+export function getCurrentHost(withProtocol: boolean = true) {
+ const protocol = window.location.protocol;
+ const host = window.location.host;
+ return withProtocol ? `${protocol}//${host}/` : `${host}/`;
+}
+
+export function getModuleUrl(module: string, config: NavigationRouteConfig) {
+ return service.getModuleUrl(module, config);
+}
+
+export function getModuleUrlTree(
+ module: string,
+ config: NavigationRouteConfig
+) {
+ return service.getModuleUrlTree(module, config);
+}
+
+export function getModuleRoute(module: string, extras = []) {
+ return service.getModuleRoute(module, extras);
+}
+
+@Injectable()
+export class NavigationService {
+ constructor(
+ @Inject(NAVIGATION_CONFIG) protected config: NavigationConfig,
+ @Inject(ROUTER_CONFIGURATION) protected routerConfig: ExtraOptions,
+ protected router: Router
+ ) {
+ service = this;
+ }
+
+ getModuleUrlTree(module: string, config: NavigationRouteConfig) {
+ const { navExtras, extras, withBase } = mergeNavConfig(config);
+ const base = (withBase === true && this.getBaseRoute(false)) || '';
+ const urlTree = this.router.createUrlTree(
+ [base, module, ...extras],
+ navExtras
+ );
+ return urlTree;
+ }
+
+ getModuleUrl(module: string, config: NavigationRouteConfig = {}) {
+ return this.appendHash(
+ this.router.serializeUrl(this.getModuleUrlTree(module, config))
+ );
+ }
+
+ getModuleRoute(module: string, extras = []): any[] {
+ return [this.getBaseRoute(false), module, ...extras];
+ }
+
+ navigateToModule(module: string, config: NavigationRouteConfig = {}) {
+ const route = this.getModuleUrlTree(module, config);
+ return this.router.navigateByUrl(route);
+ }
+
+ getBaseRoute(full: boolean = true) {
+ const baseRoute = this.config.baseRoute || '';
+ return (full && this.appendHash(baseRoute)) || baseRoute;
+ }
+
+ getRouteUrl(route: string, withBase: boolean = true, full: boolean = true) {
+ return (withBase && this.getBaseRoute(full)) || '';
+ }
+
+ protected appendHash(route: string) {
+ const withHash = toBoolean(this.routerConfig.useHash);
+ return `${withHash ? '#' : ''}${route}`;
+ }
+}
diff --git a/src/app/parse.pipe.ts b/src/app/parse.pipe.ts
new file mode 100644
index 0000000..1d0950c
--- /dev/null
+++ b/src/app/parse.pipe.ts
@@ -0,0 +1,14 @@
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'parse'
+})
+export class ParsePipe implements PipeTransform {
+ transform(value: any): any {
+ try {
+ return JSON.parse(value);
+ } catch (e) {
+ return {};
+ }
+ }
+}
diff --git a/src/app/settings/settings-routing.module.ts b/src/app/settings/settings-routing.module.ts
new file mode 100644
index 0000000..7a1fe97
--- /dev/null
+++ b/src/app/settings/settings-routing.module.ts
@@ -0,0 +1,12 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { SettingsComponent } from './settings.component';
+
+const routes: Routes = [{ path: '', component: SettingsComponent }];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class SettingsRoutingModule { }
diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html
new file mode 100644
index 0000000..4ab2a41
--- /dev/null
+++ b/src/app/settings/settings.component.html
@@ -0,0 +1 @@
+settings works!
diff --git a/src/app/settings/settings.component.scss b/src/app/settings/settings.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts
new file mode 100644
index 0000000..e47b506
--- /dev/null
+++ b/src/app/settings/settings.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-settings',
+ templateUrl: './settings.component.html',
+ styleUrls: ['./settings.component.scss']
+})
+export class SettingsComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/src/app/settings/settings.module.ts b/src/app/settings/settings.module.ts
new file mode 100644
index 0000000..018760a
--- /dev/null
+++ b/src/app/settings/settings.module.ts
@@ -0,0 +1,15 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { SettingsRoutingModule } from './settings-routing.module';
+import { SettingsComponent } from './settings.component';
+
+
+@NgModule({
+ declarations: [SettingsComponent],
+ imports: [
+ CommonModule,
+ SettingsRoutingModule
+ ]
+})
+export class SettingsModule { }
diff --git a/src/app/todos/todos-routing.module.ts b/src/app/todos/todos-routing.module.ts
new file mode 100644
index 0000000..8a38392
--- /dev/null
+++ b/src/app/todos/todos-routing.module.ts
@@ -0,0 +1,12 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { TodosComponent } from './todos.component';
+
+const routes: Routes = [{ path: '', component: TodosComponent }];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class TodosRoutingModule { }
diff --git a/src/app/todos/todos.component.html b/src/app/todos/todos.component.html
new file mode 100644
index 0000000..69f8c7a
--- /dev/null
+++ b/src/app/todos/todos.component.html
@@ -0,0 +1 @@
+todos works!
diff --git a/src/app/todos/todos.component.scss b/src/app/todos/todos.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/todos/todos.component.spec.ts b/src/app/todos/todos.component.spec.ts
new file mode 100644
index 0000000..857ae08
--- /dev/null
+++ b/src/app/todos/todos.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TodosComponent } from './todos.component';
+
+describe('TodosComponent', () => {
+ let component: TodosComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TodosComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TodosComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/todos/todos.component.ts b/src/app/todos/todos.component.ts
new file mode 100644
index 0000000..c4198aa
--- /dev/null
+++ b/src/app/todos/todos.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-todos',
+ templateUrl: './todos.component.html',
+ styleUrls: ['./todos.component.scss']
+})
+export class TodosComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/src/app/todos/todos.module.ts b/src/app/todos/todos.module.ts
new file mode 100644
index 0000000..68bd9c2
--- /dev/null
+++ b/src/app/todos/todos.module.ts
@@ -0,0 +1,15 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { TodosRoutingModule } from './todos-routing.module';
+import { TodosComponent } from './todos.component';
+
+
+@NgModule({
+ declarations: [TodosComponent],
+ imports: [
+ CommonModule,
+ TodosRoutingModule
+ ]
+})
+export class TodosModule { }
diff --git a/src/app/users/users-routing.module.ts b/src/app/users/users-routing.module.ts
new file mode 100644
index 0000000..cd0de21
--- /dev/null
+++ b/src/app/users/users-routing.module.ts
@@ -0,0 +1,12 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+
+import { UsersComponent } from './users.component';
+
+const routes: Routes = [{ path: '', component: UsersComponent }];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+export class UsersRoutingModule { }
diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html
new file mode 100644
index 0000000..065c5c6
--- /dev/null
+++ b/src/app/users/users.component.html
@@ -0,0 +1 @@
+users works!
diff --git a/src/app/users/users.component.scss b/src/app/users/users.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/src/app/users/users.component.spec.ts b/src/app/users/users.component.spec.ts
new file mode 100644
index 0000000..909b5ba
--- /dev/null
+++ b/src/app/users/users.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UsersComponent } from './users.component';
+
+describe('UsersComponent', () => {
+ let component: UsersComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ UsersComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UsersComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/users/users.component.ts b/src/app/users/users.component.ts
new file mode 100644
index 0000000..88da6cd
--- /dev/null
+++ b/src/app/users/users.component.ts
@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-users',
+ templateUrl: './users.component.html',
+ styleUrls: ['./users.component.scss']
+})
+export class UsersComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+}
diff --git a/src/app/users/users.module.ts b/src/app/users/users.module.ts
new file mode 100644
index 0000000..2183637
--- /dev/null
+++ b/src/app/users/users.module.ts
@@ -0,0 +1,15 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { UsersRoutingModule } from './users-routing.module';
+import { UsersComponent } from './users.component';
+
+
+@NgModule({
+ declarations: [UsersComponent],
+ imports: [
+ CommonModule,
+ UsersRoutingModule
+ ]
+})
+export class UsersModule { }
diff --git a/tslint.json b/tslint.json
index c8d70f1..9401209 100644
--- a/tslint.json
+++ b/tslint.json
@@ -1,5 +1,5 @@
{
- "extends": "tslint:recommended",
+ "extends": ["tslint:recommended", "tslint-config-prettier"],
"rules": {
"array-type": false,
"arrow-parens": false,
@@ -9,28 +9,12 @@
"component-class-suffix": true,
"contextual-lifecycle": true,
"directive-class-suffix": true,
- "directive-selector": [
- true,
- "attribute",
- "app",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "app",
- "kebab-case"
- ],
- "import-blacklist": [
- true,
- "rxjs/Rx"
- ],
+ "directive-selector": [true, "attribute", "app", "camelCase"],
+ "component-selector": [true, "element", "app", "kebab-case"],
+ "import-blacklist": [true, "rxjs/Rx"],
"interface-name": false,
"max-classes-per-file": false,
- "max-line-length": [
- true,
- 140
- ],
+ "max-line-length": [true, 140],
"member-access": false,
"member-ordering": [
true,
@@ -44,33 +28,17 @@
}
],
"no-consecutive-blank-lines": false,
- "no-console": [
- true,
- "debug",
- "info",
- "time",
- "timeEnd",
- "trace"
- ],
+ "no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
"no-empty": false,
- "no-inferrable-types": [
- true,
- "ignore-params"
- ],
+ "no-inferrable-types": [true, "ignore-params"],
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-switch-case-fall-through": true,
"no-var-requires": false,
- "object-literal-key-quotes": [
- true,
- "as-needed"
- ],
+ "object-literal-key-quotes": [true, "as-needed"],
"object-literal-sort-keys": false,
"ordered-imports": false,
- "quotemark": [
- true,
- "single"
- ],
+ "quotemark": [true, "single"],
"trailing-comma": false,
"no-conflicting-lifecycle": true,
"no-host-metadata-property": true,
@@ -85,7 +53,5 @@
"use-lifecycle-interface": true,
"use-pipe-transform-interface": true
},
- "rulesDirectory": [
- "codelyzer"
- ]
-}
\ No newline at end of file
+ "rulesDirectory": ["codelyzer"]
+}