diff --git a/ng6-seed/src/app/template/template.routing.ts b/ng6-seed/src/app/template/template.routing.ts
index 0872de9b2..99211e44b 100644
--- a/ng6-seed/src/app/template/template.routing.ts
+++ b/ng6-seed/src/app/template/template.routing.ts
@@ -1,15 +1,14 @@
import { Routes } from '@angular/router';
import { QuestionsModule } from './questions/questions.module';
-
+import { TemplatesModule } from './templates/templates.module';
export const TemplateRoutes: Routes = [{
path: '',
children:[{
path:'questions',
loadChildren:'./questions/questions.module#QuestionsModule'
- },
- // {
- // path:'templates',
- // loadChildren:'./templates/templates.module#TemplatesModule'
- // }
+ },{
+ path:'templates',
+ loadChildren:'./templates/templates.module#TemplatesModule'
+ }
]
}]
diff --git a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html
index 57f5a2657..a2d2f3f4e 100644
--- a/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html
+++ b/ng6-seed/src/app/template/templates/templates-list/edit/templates.edit.component.html
@@ -1,2 +1,56 @@
-
-
+
\ No newline at end of file
diff --git a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts
index 0c9bdd767..6062bc415 100644
--- a/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts
+++ b/ng6-seed/src/app/template/templates/templates-list/templates.list.component.ts
@@ -1,5 +1,6 @@
-import { Component, ViewChild, OnInit } from '@angular/core';
+import { Component, ViewChild, OnInit, OnDestroy } from '@angular/core';
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
+import { ActivatedRoute, Router } from '@angular/router';
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
import { DataSource } from '@angular/cdk/table';
import { Observable } from 'rxjs/Observable';
@@ -12,21 +13,35 @@ import { Observable } from 'rxjs/Observable';
selector: 'app-list',
templateUrl: './templates.list.component.html'
})
-export class TemplateListComponent implements OnInit {
+export class TemplateListComponent implements OnInit, OnDestroy {
public listView: boolean = true;
- constructor() {
+ public names: string;
+ constructor(
+ private route: ActivatedRoute,
+ private router: Router) {
+ // this.names = 'dinesh';
}
ngOnInit() {
// alert(1);
+ alert();
+ this.listView = true;
}
goToEdit(){
+ this.router.navigate([ '../list/edit', '1' ], { relativeTo: this.route });
this.listView = false;
}
- ngAfterViewInit(){
+ showListView(status: boolean){
// alert(2);
+ this.listView = status;
+ }
+
+ ngOnDestroy(): void {
+ //Called once, before the instance is destroyed.
+ //Add 'implements OnDestroy' to the class.
+ alert();
}
}
diff --git a/ng6-seed/src/app/template/templates/templates.module.ts b/ng6-seed/src/app/template/templates/templates.module.ts
index 2da2ac707..f7ca24067 100644
--- a/ng6-seed/src/app/template/templates/templates.module.ts
+++ b/ng6-seed/src/app/template/templates/templates.module.ts
@@ -12,7 +12,7 @@ import {
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,
MatListModule, MatMenuModule,
- MatCheckboxModule
+ MatCheckboxModule, MatStepperModule
} from '@angular/material';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -86,6 +86,7 @@ const customNotifierOptions: NotifierOptions = {
MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
+ MatStepperModule,
MatSlideToggleModule,
MatCheckboxModule,
FormsModule,
diff --git a/ng6-seed/src/app/template/templates/templates.routing.ts b/ng6-seed/src/app/template/templates/templates.routing.ts
index 6afa2b2f0..2a3003665 100644
--- a/ng6-seed/src/app/template/templates/templates.routing.ts
+++ b/ng6-seed/src/app/template/templates/templates.routing.ts
@@ -13,11 +13,15 @@ const routes: Routes = [
path: 'templates',
component: TemplatesComponent,
children: [
- {
+ {
+ path: '',
+ pathMatch: 'full',
+ redirectTo: 'list'
+ },{
path: 'list',
component: TemplateListComponent,
children: [{
- path: 'edit',
+ path: 'edit/:question-id',
component: TemplateEditComponent,
}]
}