Last active
January 25, 2017 20:29
-
-
Save EddyVerbruggen/860d81a20b245b117f412c59c8175e44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class PinComponent implements OnInit { | |
// according to Apple's documentation ID 4 is the value 'numberPad' of their keyboard type enum | |
const IOS_KEYBOARDTYPE_NUMBERPAD: number = 4; | |
// assuming you have a TextField / TextView with '#pincodeField' in your view | |
@ViewChild("pincodeField") pincodeField: ElementRef; | |
ngOnInit(): void { | |
if (this.pincodeField.nativeElement.ios) { | |
this.pincodeField.nativeElement.ios.keyboardType = IOS_KEYBOARDTYPE_NUMBERPAD; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment