-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create 3 lazy module for plates/settings/dashboard * Root app routing configuration * Added navigation component
- Loading branch information
1 parent
44f41b1
commit 25be380
Showing
23 changed files
with
305 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<footer> | ||
<navbar-button (onClick)="onNavClick(routing.Dashboard)" | ||
[active]="selectedRoute === routing.Dashboard" | ||
icon="pi-home"> | ||
</navbar-button> | ||
<navbar-button (onClick)="onNavClick(routing.Plates)" | ||
[active]="selectedRoute === routing.Plates" | ||
icon="pi-database"> | ||
</navbar-button> | ||
<navbar-button (onClick)="onNavClick(routing.Settings)" | ||
[active]="selectedRoute === routing.Settings" | ||
icon="pi-cog"> | ||
</navbar-button> | ||
</footer> | ||
|
6 changes: 0 additions & 6 deletions
6
src/app/app.component.scss → ...p/components/navbar/navbar.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {NavbarComponent} from './navbar.component'; | ||
|
||
describe('NavbarComponent', () => { | ||
let component: NavbarComponent; | ||
let fixture: ComponentFixture<NavbarComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [NavbarComponent] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(NavbarComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Component} from '@angular/core'; | ||
import {Router} from "@angular/router"; | ||
import {Routing} from "../../app-routing.module"; | ||
|
||
@Component({ | ||
selector: 'navbar', | ||
templateUrl: './navbar.component.html', | ||
styleUrls: ['./navbar.component.scss'] | ||
}) | ||
export class NavbarComponent { | ||
|
||
public selectedRoute?: Routing = undefined; | ||
|
||
constructor(private _router: Router) { | ||
} | ||
|
||
public get routing(): typeof Routing { | ||
return Routing; | ||
} | ||
|
||
public onNavClick(dest: Routing): void { | ||
this._router.navigate(['/' + dest]) | ||
.then(() => this.selectedRoute = dest); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {RouterModule, Routes} from "@angular/router"; | ||
import {DashboardComponent} from './dashboard/dashboard.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: DashboardComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
DashboardComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
RouterModule.forChild(routes) | ||
] | ||
}) | ||
export class DashboardModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span>dashboard works!</span> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/modules/dashboard/dashboard/dashboard.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {DashboardComponent} from './dashboard.component'; | ||
|
||
describe('DashboardComponent', () => { | ||
let component: DashboardComponent; | ||
let fixture: ComponentFixture<DashboardComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [DashboardComponent] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(DashboardComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
16 changes: 16 additions & 0 deletions
16
src/app/modules/dashboard/dashboard/dashboard.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'dashboard', | ||
templateUrl: './dashboard.component.html', | ||
styleUrls: ['./dashboard.component.scss'] | ||
}) | ||
export class DashboardComponent implements OnInit { | ||
|
||
constructor() { | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {PlatesComponent} from './plates/plates.component'; | ||
import {RouterModule, Routes} from "@angular/router"; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: PlatesComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
PlatesComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
RouterModule.forChild(routes) | ||
] | ||
}) | ||
export class PlatesModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span>plates works!</span> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {PlatesComponent} from './plates.component'; | ||
|
||
describe('PlatesComponent', () => { | ||
let component: PlatesComponent; | ||
let fixture: ComponentFixture<PlatesComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [PlatesComponent] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PlatesComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'plates', | ||
templateUrl: './plates.component.html', | ||
styleUrls: ['./plates.component.scss'] | ||
}) | ||
export class PlatesComponent implements OnInit { | ||
|
||
constructor() { | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from '@angular/common'; | ||
import {SettingsComponent} from './settings/settings.component'; | ||
import {RouterModule, Routes} from "@angular/router"; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: SettingsComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
SettingsComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
RouterModule.forChild(routes) | ||
] | ||
}) | ||
export class SettingsModule { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span>settings works!</span> |
Empty file.
25 changes: 25 additions & 0 deletions
25
src/app/modules/settings/settings/settings.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {ComponentFixture, TestBed} from '@angular/core/testing'; | ||
|
||
import {SettingsComponent} from './settings.component'; | ||
|
||
describe('SettingsComponent', () => { | ||
let component: SettingsComponent; | ||
let fixture: ComponentFixture<SettingsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [SettingsComponent] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SettingsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'settings', | ||
templateUrl: './settings.component.html', | ||
styleUrls: ['./settings.component.scss'] | ||
}) | ||
export class SettingsComponent implements OnInit { | ||
|
||
constructor() { | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
} |