Button "Ir" or "Send" "Ok"


#1

how to acess button “Ir” with ionic 2, i want click in “Ir” or “ok” and do login…


#2

Hi @danillo10

Can you please elaborate your issue or doubt clearly


#3

i want press button and do login…


#4

ok. In your HTML file have a button and on ng-click call login function() and in your controller have that login function() and in that function call your login service, If you get success response from login service show home page or show error message Thats it!!!


#6

i want click key “ok” on keyboard, and do logar()

<ion-col width-100>
<ion-list>
<ion-item>
<ion-label floating>Usuário</ion-label>
<ion-input type="text" value="" [(ngModel)]="loginhome.usuario"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Senha</ion-label>
<ion-input type="password" value="" [(ngModel)]="loginhome.senha"></ion-input>
</ion-item>
</ion-list>
<div padding>
<button ion-button color="primary" block type="submit" (ng-click)="logar()">Acessar</button>
</div>
</ion-col>

#7

(ng-click) work not, have you other solution ?


#8

looks like you are using IONIC 2, So please use (click)="Logar()" Instead of ng-click = "Logar()"


#9

If i use keyboard button “Ir” it’s now work, i need use keyboard…


#10

If you need to use keyboard button then wrap your input fields in form tag and add (submit)=logar() attribute, keyboard lr button works as submit button, let me know about result


#11

now it’s work, thanks my friend… i add and work!!!


#12

No problem amigos :thumbsup: