target start
This commit is contained in:
parent
20259507ea
commit
d962b01763
|
@ -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({
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<p>
|
||||||
|
list works!
|
||||||
|
</p>
|
|
@ -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();
|
||||||
|
});
|
||||||
|
});
|
15
src/app/packages/target/component/list/list.component.ts
Normal file
15
src/app/packages/target/component/list/list.component.ts
Normal 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() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
14
src/app/packages/target/target.module.ts
Normal file
14
src/app/packages/target/target.module.ts
Normal 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 { }
|
|
@ -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 },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
18
src/app/pages/targets/targets-page-routing.module.ts
Normal file
18
src/app/pages/targets/targets-page-routing.module.ts
Normal 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 { }
|
3
src/app/pages/targets/targets-page.component.html
Normal file
3
src/app/pages/targets/targets-page.component.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<div>
|
||||||
|
target page
|
||||||
|
</div>
|
0
src/app/pages/targets/targets-page.component.scss
Normal file
0
src/app/pages/targets/targets-page.component.scss
Normal 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();
|
||||||
});
|
});
|
15
src/app/pages/targets/targets-page.component.ts
Normal file
15
src/app/pages/targets/targets-page.component.ts
Normal 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() {
|
||||||
|
}
|
||||||
|
}
|
19
src/app/pages/targets/targets-page.module.ts
Normal file
19
src/app/pages/targets/targets-page.module.ts
Normal 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 { }
|
|
@ -1,3 +0,0 @@
|
||||||
<p>
|
|
||||||
targets works!
|
|
||||||
</p>
|
|
|
@ -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() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user