@dev-gilbert wrote:
Hello guys, I am having difficulties trying to implement a simple login form.
@Component({ selector: "app-login", templateUrl: "./login.page.html", styleUrls: ["./login.page.scss"] }) export class LoginPage implements OnInit { constructor(private service: AuthenticationService) {} user = {}; login() { this.service.login(); } onSubmit() { console.log(this.user); } }<form (ngSubmit)="onSubmit()"> <ion-item> <ion-label position="floating">Username</ion-label> <ion-input type="text" [(ngModel)]="user.username" name="username" ></ion-input> </ion-item> <ion-item> <ion-label position="floating">Password</ion-label> <ion-input type="text" [(ngModel)]="user.password" name="password" ></ion-input> </ion-item> <ion-button type="submit" expand="block">Sign up</ion-button> </form>When I click the sign up button I don’t see anything in the console. What am I missing here?
Posts: 1
Participants: 1