Browse Source

chat module

IbrahimNour 9 months ago
parent
commit
f43a2b8582

+ 11 - 0
src/app/modules/chat/chat-routing.module.ts

@@ -0,0 +1,11 @@
+import { NgModule } from '@angular/core';
+import { RouterModule, Routes } from '@angular/router';
+import { ChatComponent } from './chat.component';
+
+const routes: Routes = [{ path: '', component: ChatComponent, children: [] }];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule],
+})
+export class ChatRoutingModule {}

+ 2 - 0
src/app/modules/chat/chat.component.html

@@ -0,0 +1,2 @@
+<p>chat works!</p>
+<router-outlet></router-outlet>

+ 0 - 0
src/app/modules/chat/chat.component.scss


+ 21 - 0
src/app/modules/chat/chat.component.spec.ts

@@ -0,0 +1,21 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ChatComponent } from './chat.component';
+
+describe('ChatComponent', () => {
+  let component: ChatComponent;
+  let fixture: ComponentFixture<ChatComponent>;
+
+  beforeEach(() => {
+    TestBed.configureTestingModule({
+      declarations: [ChatComponent]
+    });
+    fixture = TestBed.createComponent(ChatComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 8 - 0
src/app/modules/chat/chat.component.ts

@@ -0,0 +1,8 @@
+import { Component } from '@angular/core';
+
+@Component({
+  selector: 'app-chat',
+  templateUrl: './chat.component.html',
+  styleUrls: ['./chat.component.scss'],
+})
+export class ChatComponent {}

+ 11 - 0
src/app/modules/chat/chat.module.ts

@@ -0,0 +1,11 @@
+import { NgModule } from '@angular/core';
+import { CommonModule } from '@angular/common';
+
+import { ChatRoutingModule } from './chat-routing.module';
+import { ChatComponent } from './chat.component';
+
+@NgModule({
+  declarations: [ChatComponent],
+  imports: [CommonModule, ChatRoutingModule],
+})
+export class ChatModule {}

+ 5 - 0
src/app/modules/modules-routing.module.ts

@@ -68,6 +68,11 @@ const routes: Routes = [
           ),
       },
       {
+        path: 'chat',
+        loadChildren: () =>
+          import('./chat/chat.module').then((m) => m.ChatModule),
+      },
+      {
         path: '',
         redirectTo: 'dashboard',
         pathMatch: 'full',