diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 045be83e7bbd0f56c3f29a5805bd5d48fe7b6ed6..556fb1eff9d48a66e6ac757dae24baa51a06d425 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -87,6 +87,10 @@ const routes: Routes = [ component: FormComponent, canDeactivate: [DeactivateGuard], }, + { + path: 'posts', + loadChildren: () => import('./posts/posts.module').then((m) => m.PostsModule), + }, { path: '**', redirectTo: 'home', diff --git a/src/app/posts/posts-routing.module.ts b/src/app/posts/posts-routing.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..80b37d9e9130e697c080fb8e3e85addde46d7b77 --- /dev/null +++ b/src/app/posts/posts-routing.module.ts @@ -0,0 +1,11 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; +import { PostsComponent } from './posts.component'; + +const routes: Routes = [{ path: '', component: PostsComponent }]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class PostsRoutingModule {} diff --git a/src/app/posts/posts.component.html b/src/app/posts/posts.component.html new file mode 100644 index 0000000000000000000000000000000000000000..2c30d20674b6a9d56b47b4f85851777fc4f20620 --- /dev/null +++ b/src/app/posts/posts.component.html @@ -0,0 +1 @@ +<p>posts works!</p> diff --git a/src/app/posts/posts.component.scss b/src/app/posts/posts.component.scss new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/app/posts/posts.component.spec.ts b/src/app/posts/posts.component.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..9702efa6e406b3c43a379cbcedbf4c5884337cc5 --- /dev/null +++ b/src/app/posts/posts.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostsComponent } from './posts.component'; + +describe('PostsComponent', () => { + let component: PostsComponent; + let fixture: ComponentFixture<PostsComponent>; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PostsComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(PostsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/posts/posts.component.ts b/src/app/posts/posts.component.ts new file mode 100644 index 0000000000000000000000000000000000000000..73d77fc5559743f6752fce4b2f1eda8e89f77932 --- /dev/null +++ b/src/app/posts/posts.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-posts', + templateUrl: './posts.component.html', + styleUrls: ['./posts.component.scss'] +}) +export class PostsComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/app/posts/posts.module.ts b/src/app/posts/posts.module.ts new file mode 100644 index 0000000000000000000000000000000000000000..32e4a4b79febd892e70235bc72def4fe5ebab9b0 --- /dev/null +++ b/src/app/posts/posts.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { PostsComponent } from './posts.component'; +import { PostsRoutingModule } from './posts-routing.module'; + +@NgModule({ + declarations: [PostsComponent], + imports: [CommonModule, PostsRoutingModule], +}) +export class PostsModule {}