Commit 63f87f70 authored by Priyanka Upadhye's avatar Priyanka Upadhye
Browse files

created settings menu

parent 29659628
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
redirectTo: 'login', redirectTo: 'login',
pathMatch: 'full' pathMatch: 'full'
}, },
{ {
path: 'home', path: 'home',
loadChildren: () => import('./home/home.module').then(m => m.HomePageModule) loadChildren: () => import('./home/home.module').then(m => m.HomePageModule)
}, },
{ {
path: 'list', path: 'list',
loadChildren: () => import('./list/list.module').then(m => m.ListPageModule) loadChildren: () => import('./list/list.module').then(m => m.ListPageModule)
}, },
{ {
path: 'login', path: 'login',
loadChildren: () => import('./auth/login/login.module').then( m => m.LoginPageModule) loadChildren: () => import('./auth/login/login.module').then( m => m.LoginPageModule)
}, },
{ {
path: 'register', path: 'register',
loadChildren: () => import('./auth/register/register.module').then( m => m.RegisterPageModule) loadChildren: () => import('./auth/register/register.module').then( m => m.RegisterPageModule)
}, },
{ {
path: 'myreservation', path: 'myreservation',
loadChildren: () => import('./myreservation/myreservation.module').then( m => m.MyreservationPageModule) loadChildren: () => import('./myreservation/myreservation.module').then( m => m.MyreservationPageModule)
}, },
{ {
path: 'hirebike', path: 'hirebike',
loadChildren: () => import('./hirebike/hirebike.module').then( m => m.HirebikePageModule) loadChildren: () => import('./hirebike/hirebike.module').then( m => m.HirebikePageModule)
}, },
{ {
path: 'ridehistory', path: 'ridehistory',
loadChildren: () => import('./ridehistory/ridehistory.module').then( m => m.RidehistoryPageModule) loadChildren: () => import('./ridehistory/ridehistory.module').then( m => m.RidehistoryPageModule)
}, },
{ {
path: 'feedback', path: 'feedback',
loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule) loadChildren: () => import('./feedback/feedback.module').then( m => m.FeedbackPageModule)
}, },
{ {
path: 'help-line', path: 'help-line',
loadChildren: () => import('./help-line/help-line.module').then( m => m.HelpLinePageModule) loadChildren: () => import('./help-line/help-line.module').then( m => m.HelpLinePageModule)
}, },
{ {
path: 'reset-password', path: 'reset-password',
loadChildren: () => import('./reset-password/reset-password.module').then( m => m.ResetPasswordPageModule) loadChildren: () => import('./auth/reset-password/reset-password.module').then( m => m.ResetPasswordPageModule)
}, {
path: 'settings',
loadChildren: () => import('./settings/settings.module').then( m => m.SettingsPageModule)
} }
];
];
@NgModule({
imports: [ @NgModule({
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) imports: [
], RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
exports: [RouterModule] ],
}) exports: [RouterModule]
export class AppRoutingModule {} })
export class AppRoutingModule {}
......
...@@ -48,6 +48,11 @@ export class AppComponent { ...@@ -48,6 +48,11 @@ export class AppComponent {
url: '/help-line', url: '/help-line',
icon: 'call' icon: 'call'
}, },
{
title: 'Settings',
url: '/settings',
icon: 'settings'
},
{ {
title: 'Logout', title: 'Logout',
url: '/login', url: '/login',
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import { ResetPasswordPage } from './reset-password.page'; import { SettingsPage } from './settings.page';
const routes: Routes = [ const routes: Routes = [
{ {
path: '', path: '',
component: ResetPasswordPage component: SettingsPage
} }
]; ];
...@@ -14,4 +14,4 @@ const routes: Routes = [ ...@@ -14,4 +14,4 @@ const routes: Routes = [
imports: [RouterModule.forChild(routes)], imports: [RouterModule.forChild(routes)],
exports: [RouterModule], exports: [RouterModule],
}) })
export class ResetPasswordPageRoutingModule {} export class SettingsPageRoutingModule {}
...@@ -4,17 +4,17 @@ import { FormsModule } from '@angular/forms'; ...@@ -4,17 +4,17 @@ import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { ResetPasswordPageRoutingModule } from './reset-password-routing.module'; import { SettingsPageRoutingModule } from './settings-routing.module';
import { ResetPasswordPage } from './reset-password.page'; import { SettingsPage } from './settings.page';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, CommonModule,
FormsModule, FormsModule,
IonicModule, IonicModule,
ResetPasswordPageRoutingModule SettingsPageRoutingModule
], ],
declarations: [ResetPasswordPage] declarations: [SettingsPage]
}) })
export class ResetPasswordPageModule {} export class SettingsPageModule {}
<ion-header>
<ion-toolbar color="awPrimary">
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title slot="start">
Settings
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-item (click)="ChangePassword()">
<ion-label>
Change Password
</ion-label>
</ion-item>
<ion-item (click)="DeactivateUser()">
<ion-label>
Deactivate Account
</ion-label>
</ion-item>
</ion-content>
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular'; import { IonicModule } from '@ionic/angular';
import { ResetPasswordPage } from './reset-password.page'; import { SettingsPage } from './settings.page';
describe('ResetPasswordPage', () => { describe('SettingsPage', () => {
let component: ResetPasswordPage; let component: SettingsPage;
let fixture: ComponentFixture<ResetPasswordPage>; let fixture: ComponentFixture<SettingsPage>;
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
declarations: [ ResetPasswordPage ], declarations: [ SettingsPage ],
imports: [IonicModule.forRoot()] imports: [IonicModule.forRoot()]
}).compileComponents(); }).compileComponents();
fixture = TestBed.createComponent(ResetPasswordPage); fixture = TestBed.createComponent(SettingsPage);
component = fixture.componentInstance; component = fixture.componentInstance;
fixture.detectChanges(); fixture.detectChanges();
})); }));
......
import { Component, OnInit } from '@angular/core';
import { Router, LoadChildrenCallback } from '@angular/router';
import { ToastService } from '../services/toast.service';
@Component({
selector: 'app-settings',
templateUrl: './settings.page.html',
styleUrls: ['./settings.page.scss'],
})
export class SettingsPage implements OnInit {
constructor(private router: Router,private toastService: ToastService) { }
ngOnInit() {
}
ChangePassword() {
this.router.navigateByUrl('/reset-password');
}
DeactivateUser(){
this.toastService.showToast("Account Deactivated Sucessfully");
this.router.navigateByUrl('/logout');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment