summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/test
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/test')
-rw-r--r--usecaseui-portal/src/app/test/test.component.html25
-rw-r--r--usecaseui-portal/src/app/test/test.component.less3
-rw-r--r--usecaseui-portal/src/app/test/test.component.spec.ts25
-rw-r--r--usecaseui-portal/src/app/test/test.component.ts34
4 files changed, 87 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/test/test.component.html b/usecaseui-portal/src/app/test/test.component.html
new file mode 100644
index 00000000..200be4e6
--- /dev/null
+++ b/usecaseui-portal/src/app/test/test.component.html
@@ -0,0 +1,25 @@
+<div class="test-holder">
+ <h1>Mock data works!</h1>
+ <nz-table #basicTable [nzData]="tableData">
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Phone</th>
+ <th>Address</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr *ngFor="let data of tableData">
+ <td>{{data.name}}</td>
+ <td>{{data.phone}}</td>
+ <td>{{data.address}}</td>
+ <td>
+ <a>Action δΈ€ {{data.name}}</a>
+ <nz-divider nzType="vertical"></nz-divider>
+ <a>Delete</a>
+ </td>
+ </tr>
+ </tbody>
+ </nz-table>
+</div> \ No newline at end of file
diff --git a/usecaseui-portal/src/app/test/test.component.less b/usecaseui-portal/src/app/test/test.component.less
new file mode 100644
index 00000000..a44f4e7e
--- /dev/null
+++ b/usecaseui-portal/src/app/test/test.component.less
@@ -0,0 +1,3 @@
+.test-holder{
+ margin:20px;
+} \ No newline at end of file
diff --git a/usecaseui-portal/src/app/test/test.component.spec.ts b/usecaseui-portal/src/app/test/test.component.spec.ts
new file mode 100644
index 00000000..ef4e38cb
--- /dev/null
+++ b/usecaseui-portal/src/app/test/test.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TestComponent } from './test.component';
+
+describe('TestComponent', () => {
+ let component: TestComponent;
+ let fixture: ComponentFixture<TestComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ TestComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(TestComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/usecaseui-portal/src/app/test/test.component.ts b/usecaseui-portal/src/app/test/test.component.ts
new file mode 100644
index 00000000..30fdedc7
--- /dev/null
+++ b/usecaseui-portal/src/app/test/test.component.ts
@@ -0,0 +1,34 @@
+import { Component, OnInit } from '@angular/core';
+import { TextService } from '../core/services/text.service';
+
+@Component({
+ selector: 'app-test',
+ templateUrl: './test.component.html',
+ styleUrls: ['./test.component.less']
+})
+export class TestComponent implements OnInit {
+ constructor(
+ private TextService: TextService,
+ ) {
+ }
+
+ ngOnInit() {
+ this.getMockData();
+ this.getjsonData();
+
+ }
+ tableData = []
+ getMockData() {
+ this.TextService.getfakeData().subscribe(res => {
+ console.log(res, "======fake data")
+ this.tableData = res;
+ })
+ }
+ getjsonData() {
+ this.TextService.getjsonData().subscribe(res => {
+ console.log(res, "======json data")
+ })
+ }
+
+
+}