Files
2016-05-31 15:49:56 -05:00

68 lines
1.6 KiB
TypeScript

import {Component} from '@angular/core';
import {ionicBootstrap, ActionSheet, NavController, Platform} from 'ionic-angular';
@Component({
templateUrl: 'main.html'
})
export class InitialPage {
constructor(public nav: NavController, public platform: Platform) { }
present() {
let actionSheet = ActionSheet.create({
title: 'Albums',
buttons: [
{
text: 'Delete',
role: 'destructive',
icon: !this.platform.is('ios') ? 'trash' : null,
handler: () => {
console.log('Delete clicked');
}
},
{
text: 'Share',
icon: !this.platform.is('ios') ? 'share' : null,
handler: () => {
console.log('Share clicked');
}
},
{
text: 'Play',
icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
handler: () => {
console.log('Play clicked');
}
},
{
text: 'Favorite',
icon: !this.platform.is('ios') ? 'heart-outline' : null,
handler: () => {
console.log('Favorite clicked');
}
},
{
text: 'Cancel',
role: 'cancel', // will always sort to be on the bottom
icon: !this.platform.is('ios') ? 'close' : null,
handler: () => {
console.log('Cancel clicked');
}
}
]
});
this.nav.present(actionSheet);
}
}
@Component({
templateUrl: 'app.html'
})
class ApiDemoApp {
root = InitialPage;
}
ionicBootstrap(ApiDemoApp);