import { Component } from "@angular/core" ; import { capitalizationType , Dialogs , inputType , PromptOptions , PromptResult } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./prompt-dialog.component.html" } ) export class PromptDialogComponent { displayPromptDialog ( ) { let options = { title : "Hey There" , defaultText : " Enter your mood " , message : "How you doin'" , okButtonText : "OK" , cancelButtonText : "Cancel" , neutralButtonText : "Neutral" , cancelable : true , inputType : inputType . text , capitalizationType : capitalizationType . sentences } ; Dialogs . prompt ( options ) . then ( ( result ) => { console . log ( "Hello, " + result . text ) ; } ) ; } }