import { Component , ViewChild , OnInit } from '@angular/core' ; import { NavController } from 'ionic-angular' ; import { IonDigitKeyboardCmp , IonDigitKeyboardOptions } from '../../components/ion-digit-keyboard' ; @ Component ( { selector : 'page-page1' , templateUrl : 'page1.html' } ) export class Page1 implements OnInit { @ ViewChild ( IonDigitKeyboardCmp ) keyboard ; public keyboardSettings : IonDigitKeyboardOptions = { align : 'center' , visible : false , leftActionOptions : { iconName : 'ios-backspace-outline' , fontSize : '1.4em' } , rightActionOptions : { text : '.' , fontSize : '1.3em' } , roundButtons : false , showLetters : true , swipeToHide : true , theme : 'ionic' } ; constructor ( public navCtrl ) { } ngOnInit ( ) { this . keyboard . onClick . subscribe ( ( key ) => { console . log ( 'From subscriber: ' , key ) ; } ) ; } public showKeyboard ( ) { this . keyboard . show ( ) ; } public numberClick ( key ) { console . log ( 'From event: ' , key ) ; } public hideKeyboard ( ) { this . keyboard . hide ( ) ; } }