herlanS_ hace 5 años
padre
commit
2fc8775969

+ 4 - 1
src/app/app-routing.module.ts

@@ -4,11 +4,14 @@ import {ModuleDashboardComponent} from './module/module-dashboard/module-dashboa
 import {ModuleUserComponent} from './module/module-user/module-user.component';
 import {ModuleSettingComponent} from './module/module-setting/module-setting.component';
 import {ModuleReportComponent} from './module/module-report/module-report.component';
+import {UserListComponent} from './module/module-user/user-list/user-list.component';
 
 const router:Routes = [
   {path:"",redirectTo:"dashboard",pathMatch:"full"},
   {path:"dashboard",component:ModuleDashboardComponent},
-  {path:"user",component:ModuleUserComponent},
+  {path:"user",component:ModuleUserComponent, children:[
+    {path:"",component:UserListComponent}
+  ]},
   {path:"setting",component:ModuleSettingComponent},
   {path:"report",component:ModuleReportComponent}
 ]

+ 7 - 2
src/app/app.module.ts

@@ -11,6 +11,9 @@ import { ModuleUserComponent } from './module/module-user/module-user.component'
 import { ModuleSettingComponent } from './module/module-setting/module-setting.component';
 import { ModuleReportComponent } from './module/module-report/module-report.component';
 import { AppRoutingModule } from './app-routing.module';
+import { UserListComponent } from './module/module-user/user-list/user-list.component';
+
+import { HttpClientModule }    from '@angular/common/http';
 
 @NgModule({
   declarations: [
@@ -22,11 +25,13 @@ import { AppRoutingModule } from './app-routing.module';
     ModuleDashboardComponent,
     ModuleUserComponent,
     ModuleSettingComponent,
-    ModuleReportComponent
+    ModuleReportComponent,
+    UserListComponent
   ],
   imports: [
     BrowserModule,
-    AppRoutingModule
+    AppRoutingModule,
+    HttpClientModule,
   ],
   providers: [],
   bootstrap: [AppComponent]

+ 2 - 1
src/app/module/module-user/module-user.component.html

@@ -1 +1,2 @@
-<p>module-user works!</p>
+<h4>Module User</h4>
+<router-outlet></router-outlet>

+ 1 - 0
src/app/module/module-user/user-list/user-list.component.html

@@ -0,0 +1 @@
+<p>user-list works!</p>

+ 0 - 0
src/app/module/module-user/user-list/user-list.component.scss


+ 25 - 0
src/app/module/module-user/user-list/user-list.component.spec.ts

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

+ 15 - 0
src/app/module/module-user/user-list/user-list.component.ts

@@ -0,0 +1,15 @@
+import { Component, OnInit } from '@angular/core';
+
+@Component({
+  selector: 'app-user-list',
+  templateUrl: './user-list.component.html',
+  styleUrls: ['./user-list.component.scss']
+})
+export class UserListComponent implements OnInit {
+
+  constructor() { }
+
+  ngOnInit() {
+  }
+
+}