-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee91507
commit 6d8dda2
Showing
12 changed files
with
127 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
<ion-nav [root]="rootPage"></ion-nav> | ||
<ion-menu [content]="menu"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title> | ||
Menu | ||
</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<menu></menu> | ||
</ion-content> | ||
</ion-menu> | ||
|
||
<ion-nav [root]="rootPage" #menu></ion-nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { MenuComponent } from './menu/menu'; | ||
@NgModule({ | ||
declarations: [MenuComponent], | ||
imports: [], | ||
exports: [MenuComponent] | ||
}) | ||
export class ComponentsModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<ion-item>Meu Perfil</ion-item> | ||
<ion-item (click)="logout()">Sair</ion-item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
menu { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
import { AlertController, LoadingController, MenuController, App } from 'ionic-angular'; | ||
|
||
import { LoginPage } from '../../pages/login/login'; | ||
|
||
import { ApiProvider } from '../../providers/api/api'; | ||
|
||
/** | ||
* Generated class for the MenuComponent component. | ||
* | ||
* See https://angular.io/api/core/Component for more info on Angular | ||
* Components. | ||
*/ | ||
@Component({ | ||
selector: 'menu', | ||
templateUrl: 'menu.html' | ||
}) | ||
export class MenuComponent { | ||
|
||
text: string; | ||
|
||
constructor(public alertCtrl: AlertController, public loadingCtrl: LoadingController, | ||
public app: App, public api: ApiProvider, public menuCtrl: MenuController) { | ||
console.log('Hello MenuComponent Component'); | ||
this.text = 'Hello World'; | ||
} | ||
logout() { | ||
const confirm = this.alertCtrl.create({ | ||
title: 'Um momento', | ||
message: 'Tem certeza que deseja sair?', | ||
buttons: [{ | ||
text: 'Sim', | ||
handler: () => { | ||
const load = this.loadingCtrl.create({ | ||
content: 'Saindo...' | ||
}); | ||
load.present(); | ||
this.api.logout().subscribe(res => { | ||
load.dismiss(); | ||
this.menuCtrl.close(); | ||
localStorage.removeItem("userToken"); | ||
this.app.getRootNavs()[0].setRoot(LoginPage); //Erro de tabs solved | ||
}, | ||
Error => { | ||
console.log(Error); | ||
}); | ||
} | ||
}, | ||
{ | ||
text: 'Não' | ||
}] | ||
}); | ||
confirm.present(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters