Sign In Application Won't work Please Help URGENT!

When I press sign-in nothing happens , I put the alert code in and there are no errors but doesn’t really work :thinking:

Hello

Here are a few ideas :

  • Check in your html that the signin button is linked to the signin method : there should be something like this (click)=“signIn”
  • Check that you are actually going through the signIn method by putting a console.log in the beginning of the method
  • Check that this.uname and this.password are defined when you try to get their value

I’d also advise you to add your html code in your post so we can see if there’s anything wrong in it

2 Likes

Thanks it helped a lot

can you please share your html code here?

Here you go sir :https://www.dropbox.com/s/n7gu9xor5oppa7j/Capture.PNG?dl=0

https://www.dropbox.com/s/n7gu9xor5oppa7j/Capture.PNG?dl=0 here you go sir

Here is a better way to use your inputs :
You have to define uname and password in your class.
Then you use Two-way data binding
Basically, it means that if you write something in your ts file in this.uname, it will be displayed in the uname input, and if something is entered in the uname input, it will be written in your this.uname

<ion-input type="text"  [(ngModel)]=uname ></ion-input>
<ion-input type="password"  [(ngModel)]=password ></ion-input>

You can then use the variables directly in your code (no need for viewChild)

if(this.uname=="admin" && this.password="admin"){
  //whatever you want to do here
}
2 Likes

Try Sollution given by Sachiyo, It will solve your problem.

1 Like