import { Component } from "@angular/core" ; import { Dialogs , LoginOptions , LoginResult } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./login-dialog.component.html" } ) export class LoginDialogComponent { displayLoginDialog ( ) { let options = { title : "Login Form" , message : "Enter your credentials" , okButtonText : "Login" , cancelButtonText : "Cancel" , neutralButtonText : "Neutral" , userNameHint : "Enter your username" , passwordHint : "Enter your password" , userName : "john_doe" , password : "123456" } ; Dialogs . login ( options ) . then ( ( loginResult ) => { console . log ( loginResult . result ) ; } ) ; } }