diff --git a/public/Untitled.jpeg b/public/Untitled.jpeg new file mode 100644 index 0000000..23b4418 Binary files /dev/null and b/public/Untitled.jpeg differ diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 4538eb9..1291342 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,12 +1,24 @@ import { Routes } from '@angular/router'; -import { Home } from './home/home'; import { Login } from './login/login'; import { Register } from './register/register'; +import { Dashboard } from './dashboard/dashboard'; +import { DashboardUsers } from './dashboard/dashboard-users/dashboard-users'; export const routes: Routes = [ { path: '', - component: Home, + loadComponent: () => + import('./dashboard/container/container').then((c) => c.Container), + children: [ + { + path: 'dashboard', + component: Dashboard, + }, + { + path: 'users', + component: DashboardUsers, + }, + ], }, { path: 'login', diff --git a/src/app/dashboard/container/container.css b/src/app/dashboard/container/container.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/dashboard/container/container.html b/src/app/dashboard/container/container.html new file mode 100644 index 0000000..143b127 --- /dev/null +++ b/src/app/dashboard/container/container.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/dashboard/container/container.spec.ts b/src/app/dashboard/container/container.spec.ts new file mode 100644 index 0000000..217460a --- /dev/null +++ b/src/app/dashboard/container/container.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Container } from './container'; + +describe('Container', () => { + let component: Container; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [Container] + }) + .compileComponents(); + + fixture = TestBed.createComponent(Container); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/dashboard/container/container.ts b/src/app/dashboard/container/container.ts new file mode 100644 index 0000000..06f20cb --- /dev/null +++ b/src/app/dashboard/container/container.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; +import { RouterOutlet } from '@angular/router'; +import { DashboardNavbar } from '../dashboard-navbar/dashboard-navbar'; + +@Component({ + selector: 'app-container', + imports: [RouterOutlet, DashboardNavbar], + templateUrl: './container.html', + styleUrl: './container.css', +}) +export class Container {} diff --git a/src/app/dashboard/dashboard-navbar/dashboard-navbar.css b/src/app/dashboard/dashboard-navbar/dashboard-navbar.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/dashboard/dashboard-navbar/dashboard-navbar.html b/src/app/dashboard/dashboard-navbar/dashboard-navbar.html new file mode 100644 index 0000000..24fa9ef --- /dev/null +++ b/src/app/dashboard/dashboard-navbar/dashboard-navbar.html @@ -0,0 +1,7 @@ + diff --git a/src/app/dashboard/dashboard-navbar/dashboard-navbar.spec.ts b/src/app/dashboard/dashboard-navbar/dashboard-navbar.spec.ts new file mode 100644 index 0000000..57ef083 --- /dev/null +++ b/src/app/dashboard/dashboard-navbar/dashboard-navbar.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardNavbar } from './dashboard-navbar'; + +describe('DashboardNavbar', () => { + let component: DashboardNavbar; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [DashboardNavbar] + }) + .compileComponents(); + + fixture = TestBed.createComponent(DashboardNavbar); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/dashboard/dashboard-navbar/dashboard-navbar.ts b/src/app/dashboard/dashboard-navbar/dashboard-navbar.ts new file mode 100644 index 0000000..398b2dd --- /dev/null +++ b/src/app/dashboard/dashboard-navbar/dashboard-navbar.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + +@Component({ + selector: 'app-dashboard-navbar', + imports: [RouterLink], + templateUrl: './dashboard-navbar.html', + styleUrl: './dashboard-navbar.css', +}) +export class DashboardNavbar {} diff --git a/src/app/dashboard/dashboard-users/dashboard-users.css b/src/app/dashboard/dashboard-users/dashboard-users.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/dashboard/dashboard-users/dashboard-users.html b/src/app/dashboard/dashboard-users/dashboard-users.html new file mode 100644 index 0000000..10ece67 --- /dev/null +++ b/src/app/dashboard/dashboard-users/dashboard-users.html @@ -0,0 +1,3 @@ +

dashboard-users works!

+ + diff --git a/src/app/dashboard/dashboard-users/dashboard-users.spec.ts b/src/app/dashboard/dashboard-users/dashboard-users.spec.ts new file mode 100644 index 0000000..b1b4989 --- /dev/null +++ b/src/app/dashboard/dashboard-users/dashboard-users.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { DashboardUsers } from './dashboard-users'; + +describe('DashboardUsers', () => { + let component: DashboardUsers; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [DashboardUsers] + }) + .compileComponents(); + + fixture = TestBed.createComponent(DashboardUsers); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/dashboard/dashboard-users/dashboard-users.ts b/src/app/dashboard/dashboard-users/dashboard-users.ts new file mode 100644 index 0000000..fcf31e3 --- /dev/null +++ b/src/app/dashboard/dashboard-users/dashboard-users.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; + +@Component({ + selector: 'app-dashboard-users', + imports: [], + templateUrl: './dashboard-users.html', + styleUrl: './dashboard-users.css', +}) +export class DashboardUsers {} diff --git a/src/app/dashboard/dashboard.css b/src/app/dashboard/dashboard.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/dashboard/dashboard.html b/src/app/dashboard/dashboard.html new file mode 100644 index 0000000..3e762dd --- /dev/null +++ b/src/app/dashboard/dashboard.html @@ -0,0 +1 @@ +

Dashboard Home

diff --git a/src/app/dashboard/dashboard.spec.ts b/src/app/dashboard/dashboard.spec.ts new file mode 100644 index 0000000..d4f1a13 --- /dev/null +++ b/src/app/dashboard/dashboard.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Dashboard } from './dashboard'; + +describe('Dashboard', () => { + let component: Dashboard; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [Dashboard] + }) + .compileComponents(); + + fixture = TestBed.createComponent(Dashboard); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/dashboard/dashboard.ts b/src/app/dashboard/dashboard.ts new file mode 100644 index 0000000..dcfff61 --- /dev/null +++ b/src/app/dashboard/dashboard.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; +import { RouterLink, RouterOutlet } from '@angular/router'; +import { DashboardNavbar } from './dashboard-navbar/dashboard-navbar'; + +@Component({ + selector: 'app-dashboard', + imports: [RouterLink, RouterOutlet, DashboardNavbar], + templateUrl: './dashboard.html', + styleUrl: './dashboard.css', +}) +export class Dashboard {} diff --git a/src/app/login/login.html b/src/app/login/login.html index 147cfc4..52430ca 100644 --- a/src/app/login/login.html +++ b/src/app/login/login.html @@ -1 +1,3 @@

login works!

+ + diff --git a/src/app/login/login.ts b/src/app/login/login.ts index c39dbb9..7027c09 100644 --- a/src/app/login/login.ts +++ b/src/app/login/login.ts @@ -1,11 +1,10 @@ import { Component } from '@angular/core'; +import { RouterLink } from '@angular/router'; @Component({ selector: 'app-login', - imports: [], + imports: [RouterLink], templateUrl: './login.html', - styleUrl: './login.css' + styleUrl: './login.css', }) -export class Login { - -} +export class Login {} diff --git a/src/app/register/register.html b/src/app/register/register.html index 6b0ba2e..48507e2 100644 --- a/src/app/register/register.html +++ b/src/app/register/register.html @@ -1 +1,42 @@ -

register works!

+
+ + + +

Address

+
+ + + + + + +
+ +
diff --git a/src/app/register/register.ts b/src/app/register/register.ts index b0da4cc..b87d497 100644 --- a/src/app/register/register.ts +++ b/src/app/register/register.ts @@ -1,9 +1,14 @@ import { Component } from '@angular/core'; -import { FormControl, FormGroup, Validators } from '@angular/forms'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; @Component({ selector: 'app-register', - imports: [], + imports: [ReactiveFormsModule], templateUrl: './register.html', styleUrl: './register.css', }) @@ -12,17 +17,26 @@ export class Register { ngOnInit() { this.registrationForm = new FormGroup({ - email: new FormControl('', Validators.required), + email: new FormControl('', [Validators.required, Validators.email]), username: new FormControl('', Validators.required), password: new FormControl('', Validators.required), address: new FormGroup({ - street1: new FormControl(''), + street1: new FormControl('', Validators.required), street2: new FormControl(''), - city: new FormControl(''), - state: new FormControl(''), - zip: new FormControl(''), - country: new FormControl(''), + city: new FormControl('', Validators.required), + state: new FormControl('', Validators.required), + zip: new FormControl('', [Validators.required]), + country: new FormControl('', Validators.required), }), }); } + + submit() { + if (!this.registrationForm.valid) { + for (const control in this.registrationForm.controls) { + console.log(this.registrationForm.controls[control].errors); + } + return; + } + } }