target start

This commit is contained in:
insanity 2018-02-01 19:48:00 +09:00
parent 20259507ea
commit d962b01763
16 changed files with 122 additions and 27 deletions

View File

@ -5,7 +5,7 @@ const routes: Routes = [
{ path: '', loadChildren: './pages/pages.module#PagesModule' }, { path: '', loadChildren: './pages/pages.module#PagesModule' },
{ path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' }, { path: 'auth', loadChildren: './pages/auth/auth-page.module#AuthPageModule' },
{ path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' }, { path: 'errors', loadChildren: './pages/errors/errors-page.module#ErrorsPageModule' },
{ path: '**', redirectTo: 'errors/404' } // { path: '**', redirectTo: 'errors/404' }
]; ];
@NgModule({ @NgModule({

View File

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

View File

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

View File

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

View File

@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ListComponent } from 'app/packages/target/component/list/list.component';
@NgModule({
imports: [
CommonModule
],
declarations: [ListComponent],
exports: [
ListComponent
]
})
export class TargetModule { }

View File

@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { ProbePageComponent } from './probe-page.component'; import { ProbePageComponent } from './probe-page.component';
import { DetailComponent as ProbeDetailComponent } from 'app/packages/probe/component/detail/detail.component'; import { DetailComponent as ProbeDetailComponent } from 'app/packages/probe/component/detail/detail.component';
import { ListComponent as TargetListComponent } from 'app/packages/target/component/list/list.component';
const routes: Routes = [ const routes: Routes = [
{ {
@ -9,7 +10,7 @@ const routes: Routes = [
component: ProbePageComponent, component: ProbePageComponent,
children: [ children: [
{ path: ':id', component: ProbeDetailComponent }, { path: ':id', component: ProbeDetailComponent },
{ path: ':id/target', component: ProbeDetailComponent }, { path: ':id/targets', loadChildren: 'app/pages/targets/targets-page.module#TargetsPageModule'},
{ path: ':id/history', component: ProbeDetailComponent }, { path: ':id/history', component: ProbeDetailComponent },
] ]
} }

View File

@ -16,8 +16,8 @@ export class ProbePageComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.tabs = [ this.tabs = [
{ label: 'Info', path: this.router.url }, { label: 'Info', path: this.router.url },
{ label: 'Targets', path: '/target' }, { label: 'Targets', path: this.router.url + '/targets' },
{ label: 'History', path: '/probe/history' }, { label: 'History', path: this.router.url + '/history' },
]; ];
} }

View File

@ -0,0 +1,18 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ListComponent as ProbeListComponent } from 'app/packages/probe/component/list/list.component';
import { TargetsPageComponent } from 'app/pages/targets/targets-page.component';
const routes: Routes = [
{
path: '',
component: TargetsPageComponent,
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class TargetsPageRoutingModule { }

View File

@ -0,0 +1,3 @@
<div>
target page
</div>

View File

@ -1,20 +1,20 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TargetsComponent } from './targets.component'; import { TargetsPageComponent } from './targets-page.component';
describe('TargetsComponent', () => { describe('TargetsComponent', () => {
let component: TargetsComponent; let component: TargetsPageComponent;
let fixture: ComponentFixture<TargetsComponent>; let fixture: ComponentFixture<TargetsPageComponent>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ TargetsComponent ] declarations: [ TargetsPageComponent ]
}) })
.compileComponents(); .compileComponents();
})); }));
beforeEach(() => { beforeEach(() => {
fixture = TestBed.createComponent(TargetsComponent); fixture = TestBed.createComponent(TargetsPageComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
}); });

View File

@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'of-pages-targets',
templateUrl: './targets-page.component.html',
styleUrls: ['./targets-page.component.scss']
})
export class TargetsPageComponent implements OnInit {
constructor() {
}
ngOnInit() {
}
}

View File

@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MaterialModule } from 'app/commons/ui/material/material.module';
import { SubMenubarModule } from 'app/commons/component/sub-menubar/sub-menubar.module';
import { TargetsPageComponent } from 'app/pages/targets/targets-page.component';
import { TargetModule } from 'app/packages/target/target.module';
import { TargetsPageRoutingModule } from 'app/pages/targets/targets-page-routing.module';
@NgModule({
imports: [
CommonModule,
MaterialModule,
TargetsPageRoutingModule
],
declarations: [
TargetsPageComponent
]
})
export class TargetsPageModule { }

View File

@ -1,3 +0,0 @@
<p>
targets works!
</p>

View File

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