在Ionic 2中使用弹出窗口

Asenjo

当我尝试在单击按钮后显示警报弹出窗口时,出现以下错误:

例外:TypeError:无法读取[null]中未定义的属性'length'原始例外:TypeError:无法读取未定义的属性'length'

这是我的代码:

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'
       });
  }
}

一些小费?

Asenjo

这是Ionic2版本的一个错误。更新到版本alpha 37后,按预期方式工作。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章