herlanS_ 5 gadi atpakaļ
vecāks
revīzija
215877ceaa

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

@@ -5,12 +5,14 @@ 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';
+import {UserAddComponent} from './module/module-user/user-add/user-add.component';
 
 const router:Routes = [
   {path:"",redirectTo:"dashboard",pathMatch:"full"},
   {path:"dashboard",component:ModuleDashboardComponent},
   {path:"user",component:ModuleUserComponent, children:[
-    {path:"",component:UserListComponent}
+    {path:"",component:UserListComponent},
+    {path:"add",component:UserAddComponent}
   ]},
   {path:"setting",component:ModuleSettingComponent},
   {path:"report",component:ModuleReportComponent}

+ 6 - 1
src/app/app.module.ts

@@ -14,6 +14,9 @@ import { AppRoutingModule } from './app-routing.module';
 import { UserListComponent } from './module/module-user/user-list/user-list.component';
 
 import { HttpClientModule }    from '@angular/common/http';
+import { UserAddComponent } from './module/module-user/user-add/user-add.component';
+
+import { FormsModule } from '@angular/forms';
 
 @NgModule({
   declarations: [
@@ -26,12 +29,14 @@ import { HttpClientModule }    from '@angular/common/http';
     ModuleUserComponent,
     ModuleSettingComponent,
     ModuleReportComponent,
-    UserListComponent
+    UserListComponent,
+    UserAddComponent
   ],
   imports: [
     BrowserModule,
     AppRoutingModule,
     HttpClientModule,
+    FormsModule
   ],
   providers: [],
   bootstrap: [AppComponent]

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

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

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


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

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

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

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

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

@@ -1,3 +1,4 @@
+<a routerLink="/user/add">Add</a>
 <ul>
     <li class="userlist" *ngFor="let user of users">
         <h5>{{user.username}}</h5>