-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from hfwittmann/master
alert controller
- Loading branch information
Showing
5 changed files
with
116 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,55 @@ | ||
'use strict'; | ||
|
||
import { Component } from '@angular/core'; | ||
import { Component } from '@angular/core'; | ||
import { Alert, AlertController } from 'ionic-angular'; | ||
|
||
@Component({ | ||
templateUrl: './page2.html', | ||
}) | ||
|
||
export class Page2 { | ||
|
||
public okEd: boolean; | ||
public alert1: Alert; | ||
public alertController: AlertController; | ||
|
||
constructor(alertController: AlertController) { | ||
this.alertController = alertController; | ||
|
||
}; | ||
|
||
public title: string = 'Page 2'; | ||
|
||
public onGainChange(): void { | ||
return; | ||
} | ||
|
||
public showSimpleAlert(): any { | ||
|
||
this.alert1 = this.alertController.create({ | ||
title: 'This is an example for an alert', | ||
buttons: ['Ok', 'Dismiss'], | ||
}); | ||
|
||
this.alert1.present(); | ||
} | ||
|
||
public showMoreAdvancedAlert(): any { | ||
|
||
this.alert1 = this.alertController.create({ | ||
title: 'This is an example for an alert', | ||
buttons: [{ | ||
text: 'More Advanced Ok', | ||
handler: this.OK, | ||
} | ||
, 'Dismiss'], | ||
}); | ||
|
||
this.alert1.present(); | ||
} | ||
|
||
public OK = () => { | ||
|
||
this.okEd = true; | ||
} | ||
} |