Я пытаюсь протестировать все компоненты Ionic 2, но я не знаю, как использовать Actionsheets.Использование Actionsheet в Ionic 2
У меня есть этот код:
actionSheet.html:
<button (click)="showActionSheet()">Show Actionsheet</button>
actionSheet.js:
import {Page, NavController} from 'ionic/ionic';
import {ActionSheet} from 'ionic/ionic';
@Page({
templateUrl: 'app/actionSheet/actionSheet.html'
})
export class ActionSheetPage {
constructor(nav: NavController) {
this.nav = nav;
}
showActionSheet() {
ActionSheet.open({
buttons: [
{ text: 'Share This' },
{ text: 'Move' }
],
destructiveText: 'Delete',
titleText: 'Modify your album',
cancelText: 'Cancel',
cancel:() => {
console.log('Canceled');
},
destructiveButtonClicked:() => {
console.log('Destructive clicked');
},
buttonClicked: (index) => {
console.log('Button clicked: ', index);
}
}).then(actionSheetRef => {
// Action sheet was created and opened
this.actionSheetRef = actionSheetRef;
// this.actionSheetRef.close() to close it
})
}
}
При нажатии на кнопку у меня есть эта ошибка :
19 010801 error EXCEPTION: Error during evaluation of "click" 20 010804 error ORIGINAL EXCEPTION: TypeError: ionic_2.ActionSheet.open is not a function 21 010806 error ORIGINAL STACKTRACE: 22 010808 error TypeError: ionic_2.ActionSheet.open is not a function
Какой отзыв?