单击按钮后尝试显示警报弹出窗口时出现以下错误:
异常:TypeError:无法读取 [null] 中未定义的属性“长度”原始异常:TypeError:无法读取未定义的属性“长度”
这是我的代码:
popups.html:
<ion-content padding class="getting-started">
<button primary (click)="showAlertPopup()">Alert</button>
</ion-content>
popups.js
import {Page, NavController, Popup} from 'ionic/ionic';
@Page({
templateUrl: 'app/popups/popups.html'
})
export class PopupsPage {
constructor(nav: NavController, popup: Popup) {
this.nav = nav;
this.popup = popup;
}
showAlertPopup(){
this.popup.alert({
title: 'Ionic Popup',
template: 'This is alert popup'
});
}
}
一些小费?