From 91ab8962a0b34b0f3d1568e8246a4f6af9b32a3b Mon Sep 17 00:00:00 2001 From: kusowl Date: Thu, 19 Feb 2026 12:02:47 +0530 Subject: [PATCH] Add routing conifguration and default login page --- src/app/app.html | 2 +- src/app/app.routes.ts | 13 ++++++++++++- src/app/features/home/home.html | 2 +- src/app/features/home/home.ts | 7 +++---- src/app/features/login/login.css | 0 src/app/features/login/login.html | 1 + src/app/features/login/login.spec.ts | 23 +++++++++++++++++++++++ src/app/features/login/login.ts | 11 +++++++++++ 8 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 src/app/features/login/login.css create mode 100644 src/app/features/login/login.html create mode 100644 src/app/features/login/login.spec.ts create mode 100644 src/app/features/login/login.ts diff --git a/src/app/app.html b/src/app/app.html index a3489e5..47869cd 100644 --- a/src/app/app.html +++ b/src/app/app.html @@ -1,3 +1,3 @@ - + diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index dc39edb..220b374 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,3 +1,14 @@ import { Routes } from '@angular/router'; +import { Login } from './features/login/login'; +import { Home } from './features/home/home'; -export const routes: Routes = []; +export const routes: Routes = [ + { + path: '', + component: Home, + }, + { + path: 'login', + component: Login, + }, +]; diff --git a/src/app/features/home/home.html b/src/app/features/home/home.html index 5f2c53f..bd4f566 100644 --- a/src/app/features/home/home.html +++ b/src/app/features/home/home.html @@ -1 +1 @@ -

home works!

+ diff --git a/src/app/features/home/home.ts b/src/app/features/home/home.ts index 102523e..00ad828 100644 --- a/src/app/features/home/home.ts +++ b/src/app/features/home/home.ts @@ -1,11 +1,10 @@ import { Component } from '@angular/core'; +import { Products } from './products/products'; @Component({ selector: 'app-home', - imports: [], + imports: [Products], templateUrl: './home.html', styleUrl: './home.css', }) -export class Home { - -} +export class Home {} diff --git a/src/app/features/login/login.css b/src/app/features/login/login.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/features/login/login.html b/src/app/features/login/login.html new file mode 100644 index 0000000..147cfc4 --- /dev/null +++ b/src/app/features/login/login.html @@ -0,0 +1 @@ +

login works!

diff --git a/src/app/features/login/login.spec.ts b/src/app/features/login/login.spec.ts new file mode 100644 index 0000000..8d4c63e --- /dev/null +++ b/src/app/features/login/login.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { Login } from './login'; + +describe('Login', () => { + let component: Login; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [Login] + }) + .compileComponents(); + + fixture = TestBed.createComponent(Login); + component = fixture.componentInstance; + await fixture.whenStable(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/features/login/login.ts b/src/app/features/login/login.ts new file mode 100644 index 0000000..81f5eba --- /dev/null +++ b/src/app/features/login/login.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-login', + imports: [], + templateUrl: './login.html', + styleUrl: './login.css', +}) +export class Login { + +}