template pages created : kdk
This commit is contained in:
parent
3bdd446b07
commit
2bad305dbd
@ -21,7 +21,7 @@ import { DemoMaterialModule } from '../shared/demo.module';
|
|||||||
import 'hammerjs';
|
import 'hammerjs';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
import { TemplatesModule } from './templates/templates.module';
|
||||||
import { QuestionsModule } from './questions/questions.module';
|
import { QuestionsModule } from './questions/questions.module';
|
||||||
/** Template Routes */
|
/** Template Routes */
|
||||||
import { TemplateRoutes } from './template.routing';
|
import { TemplateRoutes } from './template.routing';
|
||||||
@ -35,6 +35,7 @@ import { MastersService } from './service/masters/masters.service';
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterModule.forChild(TemplateRoutes),
|
RouterModule.forChild(TemplateRoutes),
|
||||||
|
TemplatesModule,
|
||||||
QuestionsModule,
|
QuestionsModule,
|
||||||
MatCardModule,
|
MatCardModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
|
|||||||
@ -6,6 +6,10 @@ export const TemplateRoutes: Routes = [{
|
|||||||
children:[{
|
children:[{
|
||||||
path:'questions',
|
path:'questions',
|
||||||
loadChildren:'./questions/questions.module#QuestionsModule'
|
loadChildren:'./questions/questions.module#QuestionsModule'
|
||||||
}
|
},
|
||||||
|
// {
|
||||||
|
// path:'templates',
|
||||||
|
// loadChildren:'./templates/templates.module#TemplatesModule'
|
||||||
|
// }
|
||||||
]
|
]
|
||||||
}]
|
}]
|
||||||
|
|||||||
@ -0,0 +1,2 @@
|
|||||||
|
<button>Back To List</button>
|
||||||
|
<h3>Template Edit Component</h3>
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||||
|
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
|
||||||
|
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
|
||||||
|
import { DataSource } from '@angular/cdk/table';
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Template Edit component
|
||||||
|
* : kdk
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'app-list',
|
||||||
|
templateUrl: './templates.edit.component.html'
|
||||||
|
})
|
||||||
|
export class TemplateEditComponent implements OnInit {
|
||||||
|
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
<div *ngIf="listView">
|
||||||
|
<h3>Template List Component</h3>
|
||||||
|
<button (click)="goToEdit()">Edit</button>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="!listView">
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
import { Component, ViewChild, OnInit } from '@angular/core';
|
||||||
|
import { MatPaginator, MatSort, MatTableDataSource, MatDialog, PageEvent } from '@angular/material';
|
||||||
|
import { FormGroup, FormControl, FormBuilder } from '@angular/forms';
|
||||||
|
import { DataSource } from '@angular/cdk/table';
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Template List component
|
||||||
|
* : kdk
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'app-list',
|
||||||
|
templateUrl: './templates.list.component.html'
|
||||||
|
})
|
||||||
|
export class TemplateListComponent implements OnInit {
|
||||||
|
public listView: boolean = true;
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
// alert(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
goToEdit(){
|
||||||
|
this.listView = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ngAfterViewInit(){
|
||||||
|
// alert(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
10
ng6-seed/src/app/template/templates/templates.component.ts
Normal file
10
ng6-seed/src/app/template/templates/templates.component.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
@Component({
|
||||||
|
template: `<h2>Templates Master Details List</h2>
|
||||||
|
<div>
|
||||||
|
<router-outlet></router-outlet>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class TemplatesComponent {
|
||||||
|
}
|
||||||
106
ng6-seed/src/app/template/templates/templates.module.ts
Normal file
106
ng6-seed/src/app/template/templates/templates.module.ts
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
|
||||||
|
import { NotifierModule, NotifierOptions } from 'angular-notifier';
|
||||||
|
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||||
|
import {
|
||||||
|
MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule,MatTableModule,MatPaginatorModule,
|
||||||
|
MatProgressBarModule,MatDialogModule, MatSortModule,
|
||||||
|
MatToolbarModule,MatSelectModule,
|
||||||
|
MatListModule, MatMenuModule,
|
||||||
|
MatCheckboxModule
|
||||||
|
} from '@angular/material';
|
||||||
|
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
// Questions Routing import
|
||||||
|
import { TemplatesRouting } from './templates.routing';
|
||||||
|
|
||||||
|
import { TemplatesComponent } from './templates.component';
|
||||||
|
import { TemplateListComponent } from './templates-list/templates.list.component';
|
||||||
|
import { TemplateEditComponent } from './templates-list/edit/templates.edit.component';
|
||||||
|
|
||||||
|
// import { QuestionsService } from './../service/questions/questions.service';
|
||||||
|
/*
|
||||||
|
* Question Master Module details
|
||||||
|
* : kdk
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Custom angular notifier options
|
||||||
|
*/
|
||||||
|
const customNotifierOptions: NotifierOptions = {
|
||||||
|
position: {
|
||||||
|
horizontal: {
|
||||||
|
position: 'right',
|
||||||
|
distance: 12
|
||||||
|
},
|
||||||
|
vertical: {
|
||||||
|
position: 'top',
|
||||||
|
distance: 32,
|
||||||
|
gap: 10
|
||||||
|
}
|
||||||
|
},
|
||||||
|
theme: 'material',
|
||||||
|
behaviour: {
|
||||||
|
autoHide: 5000,
|
||||||
|
onClick: 'hide',
|
||||||
|
onMouseover: 'pauseAutoHide',
|
||||||
|
showDismissButton: true,
|
||||||
|
stacking: 4
|
||||||
|
},
|
||||||
|
animations: {
|
||||||
|
enabled: true,
|
||||||
|
show: {
|
||||||
|
preset: 'slide',
|
||||||
|
speed: 300,
|
||||||
|
easing: 'ease'
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
preset: 'fade',
|
||||||
|
speed: 300,
|
||||||
|
easing: 'ease',
|
||||||
|
offset: 50
|
||||||
|
},
|
||||||
|
shift: {
|
||||||
|
speed: 300,
|
||||||
|
easing: 'ease'
|
||||||
|
},
|
||||||
|
overlap: 150
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
NotifierModule.withConfig(customNotifierOptions),
|
||||||
|
FlexLayoutModule,
|
||||||
|
MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule,MatTableModule,MatPaginatorModule,
|
||||||
|
MatProgressBarModule,MatDialogModule, MatSortModule,
|
||||||
|
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
|
||||||
|
MatSlideToggleModule,
|
||||||
|
MatCheckboxModule,
|
||||||
|
FormsModule,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
TemplatesRouting
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
TemplatesComponent,
|
||||||
|
TemplateListComponent,
|
||||||
|
TemplateEditComponent
|
||||||
|
],
|
||||||
|
entryComponents: [
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
// QuestionsService
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class TemplatesModule { }
|
||||||
32
ng6-seed/src/app/template/templates/templates.routing.ts
Normal file
32
ng6-seed/src/app/template/templates/templates.routing.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
// Templates Component
|
||||||
|
import { TemplatesComponent } from './templates.component';
|
||||||
|
import { TemplateListComponent } from './templates-list/templates.list.component';
|
||||||
|
import { TemplateEditComponent } from './templates-list/edit/templates.edit.component';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Templates Master Router Module details
|
||||||
|
*/
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: 'templates',
|
||||||
|
component: TemplatesComponent,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
component: TemplateListComponent,
|
||||||
|
children: [{
|
||||||
|
path: 'edit',
|
||||||
|
component: TemplateEditComponent,
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class TemplatesRouting {}
|
||||||
Loading…
Reference in New Issue
Block a user