how to acess button “Ir” with ionic 2, i want click in “Ir” or “ok” and do login…
i want press button and do login…
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!!!
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>
(ng-click) work not, have you other solution ?
looks like you are using IONIC 2, So please use (click)="Logar()"
Instead of ng-click = "Logar()"
If i use keyboard button “Ir” it’s now work, i need use keyboard…
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
now it’s work, thanks my friend… i add and work!!!
No problem amigos