import {Component, Directive} from 'angular2/angular2';
import {App, ActionMenu, IonicApp, IonicView, Register} from 'ionic/ionic';
@IonicView({
template: '' +
'Heading' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
'' +
`
All Genres
Jan 17 2015
Alternative
Blues
` +
''
})
export class FirstPage {
constructor(app: IonicApp, actionMenu: ActionMenu) {
this.app = app;
this.actionMenu = actionMenu;
}
toggleMenu() {
console.log('TOGGLE');
this.app.getComponent('myAside').toggle();
}
showMoreMenu() {
this.actionMenu.open({
buttons: [
{ icon: 'ion-android-share-alt', text: 'Share' },
{ icon: 'ion-arrow-move', text: 'Move' }
],
destructiveText: 'Delete',
titleText: 'Modify your album',
cancelText: 'Cancel',
cancel: function() {
console.log('Canceled');
},
destructiveButtonClicked: () => {
console.log('Destructive clicked');
},
buttonClicked: function(index) {
console.log('Button clicked', index);
if(index == 1) { return false; }
return true;
}
}).then(actionMenuRef => {
this.actionMenuRef = actionMenuRef;
});
}
}
@App({
template: `
`,
routes: [
{
path: '/first',
component: FirstPage,
root: true
}
]
})
class MyApp {
constructor() {
}
}