@burbians wrote:
Hello,
I have the error below when I try to show an alert popup after click on a button:
EXCEPTION: TypeError: Cannot read property 'length' of undefined in [null]
ORIGINAL EXCEPTION: TypeError: Cannot read property 'length' of undefinedThis is my code:
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', }); } }
Thanks in advantage
Posts: 3
Participants: 3