-
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.
feat: created structure of components and routes with lazy loading
- Loading branch information
1 parent
b5ca748
commit ef74890
Showing
34 changed files
with
314 additions
and
66 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 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 |
---|---|---|
@@ -1,10 +1,42 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { HomeComponent } from './features/home/home.component'; | ||
|
||
const routes: Routes = []; | ||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
pathMatch: 'full', | ||
component: HomeComponent, | ||
}, | ||
|
||
{ | ||
path: '', | ||
loadChildren: () => import('./routes').then((mod) => mod.home), | ||
}, | ||
|
||
{ | ||
path: 'admin', | ||
loadChildren: () => import('./routes').then((mod) => mod.admin), | ||
}, | ||
|
||
{ | ||
path: '', | ||
loadChildren: () => import('./routes').then((mod) => mod.auth), | ||
}, | ||
|
||
{ | ||
path: 'user', | ||
loadChildren: () => import('./routes').then((mod) => mod.user), | ||
}, | ||
|
||
{ | ||
path: '**', | ||
loadChildren: () => import('./routes').then((mod) => mod.notFoundPage), | ||
}, | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forRoot(routes)], | ||
exports: [RouterModule] | ||
exports: [RouterModule], | ||
}) | ||
export class AppRoutingModule { } | ||
export class AppRoutingModule {} |
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 @@ | ||
<p>admin-panel works!</p> |
Empty file.
21 changes: 21 additions & 0 deletions
21
src/app/features/admin/admin-panel/admin-panel.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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AdminPanelComponent } from './admin-panel.component'; | ||
|
||
describe('AdminPanelComponent', () => { | ||
let component: AdminPanelComponent; | ||
let fixture: ComponentFixture<AdminPanelComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [AdminPanelComponent], | ||
}); | ||
fixture = TestBed.createComponent(AdminPanelComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/app/features/admin/admin-panel/admin-panel.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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-admin-panel', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './admin-panel.component.html', | ||
styleUrls: ['./admin-panel.component.scss'], | ||
}) | ||
export class AdminPanelComponent {} |
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 @@ | ||
<p>login works!</p> |
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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoginComponent } from './login.component'; | ||
|
||
describe('LoginComponent', () => { | ||
let component: LoginComponent; | ||
let fixture: ComponentFixture<LoginComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [LoginComponent], | ||
}); | ||
fixture = TestBed.createComponent(LoginComponent); | ||
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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-login', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './login.component.html', | ||
styleUrls: ['./login.component.scss'], | ||
}) | ||
export class LoginComponent {} |
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 @@ | ||
<p>register works!</p> |
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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { RegisterComponent } from './register.component'; | ||
|
||
describe('RegisterComponent', () => { | ||
let component: RegisterComponent; | ||
let fixture: ComponentFixture<RegisterComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [RegisterComponent], | ||
}); | ||
fixture = TestBed.createComponent(RegisterComponent); | ||
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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-register', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './register.component.html', | ||
styleUrls: ['./register.component.scss'], | ||
}) | ||
export class RegisterComponent {} |
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 @@ | ||
<p>home works!</p> |
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,27 @@ | ||
/* tslint:disable:no-unused-variable */ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { By } from '@angular/platform-browser'; | ||
import { DebugElement } from '@angular/core'; | ||
|
||
import { HomeComponent } from './home.component'; | ||
|
||
describe('HomeComponent', () => { | ||
let component: HomeComponent; | ||
let fixture: ComponentFixture<HomeComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [HomeComponent], | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(HomeComponent); | ||
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,15 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-home', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './home.component.html', | ||
styleUrls: ['./home.component.scss'], | ||
}) | ||
export class HomeComponent implements OnInit { | ||
constructor() {} | ||
|
||
ngOnInit() {} | ||
} |
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 @@ | ||
<p>not-found-page works!</p> |
Empty file.
21 changes: 21 additions & 0 deletions
21
src/app/features/not-found-page/not-found-page.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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { NotFoundPageComponent } from './not-found-page.component'; | ||
|
||
describe('NotFoundPageComponent', () => { | ||
let component: NotFoundPageComponent; | ||
let fixture: ComponentFixture<NotFoundPageComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [NotFoundPageComponent], | ||
}); | ||
fixture = TestBed.createComponent(NotFoundPageComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
src/app/features/not-found-page/not-found-page.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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-not-found-page', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './not-found-page.component.html', | ||
styleUrls: ['./not-found-page.component.scss'], | ||
}) | ||
export class NotFoundPageComponent {} |
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 @@ | ||
<p>user-panel works!</p> |
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,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { UserPanelComponent } from './user-panel.component'; | ||
|
||
describe('UserPanelComponent', () => { | ||
let component: UserPanelComponent; | ||
let fixture: ComponentFixture<UserPanelComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [UserPanelComponent], | ||
}); | ||
fixture = TestBed.createComponent(UserPanelComponent); | ||
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,11 @@ | ||
import { Component } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'app-user-panel', | ||
standalone: true, | ||
imports: [CommonModule], | ||
templateUrl: './user-panel.component.html', | ||
styleUrls: ['./user-panel.component.scss'], | ||
}) | ||
export class UserPanelComponent {} |
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,24 @@ | ||
import { Routes } from '@angular/router'; | ||
import { AdminPanelComponent } from './features/admin/admin-panel/admin-panel.component'; | ||
import { LoginComponent } from './features/auth/login/login.component'; | ||
import { RegisterComponent } from './features/auth/register/register.component'; | ||
import { HomeComponent } from './features/home/home.component'; | ||
import { NotFoundPageComponent } from './features/not-found-page/not-found-page.component'; | ||
import { UserPanelComponent } from './features/user-panel/user-panel.component'; | ||
|
||
export const home: Routes = [{ path: '', component: HomeComponent }]; | ||
|
||
export const admin: Routes = [ | ||
{ path: 'admin', component: AdminPanelComponent }, | ||
]; | ||
|
||
export const auth: Routes = [ | ||
{ path: 'auth/login', component: LoginComponent }, | ||
{ path: 'auth/register', component: RegisterComponent }, | ||
]; | ||
|
||
export const user: Routes = [{ path: 'user', component: UserPanelComponent }]; | ||
|
||
export const notFoundPage: Routes = [ | ||
{ path: '**', component: NotFoundPageComponent }, | ||
]; |
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>FinancesV20</title> | ||
<base href="/"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com"> | ||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> | ||
</head> | ||
<body class="mat-typography"> | ||
<app-root></app-root> | ||
</body> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>FinancesV20</title> | ||
<base href="/" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="favicon.ico" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link | ||
href="https://fonts.googleapis.com/icon?family=Material+Icons" | ||
rel="stylesheet" | ||
/> | ||
</head> | ||
<body class="mat-typography"> | ||
<app-root></app-root> | ||
</body> | ||
</html> |
Oops, something went wrong.