Hey Guys,
So in my trying to make light of a tutorial im reading.
In my login.html form i have the following code
<form *ngSwitchCase="'login'" #loginCreds="ngForm" (ngSubmit)="login(loginCreds.value)">
<ion-item>
<ion-label>Username</ion-label>
<ion-input type="text" ngControl="email"></ion-input>
</ion-item>
<ion-item>
<ion-label>Password</ion-label>
<ion-input type="password" ngControl="password"></ion-input>
</ion-item>
<div padding>
<button block type="submit">Login</button>
</div>
</form>
Then in my login.ts i have the following
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AuthService } from '../../providers/auth-service/auth-service';
import { HomePage } from '../home/home';
@Component({
templateUrl: 'build/pages/login/login.html',
})
export class LoginPage {
authType: string = "login";
constructor( private auth: AuthService, private navCtrl: NavController ) {}
login(credentials) {
console.log(credentials)
}
}
When i run it, the console shows an empty object … Im so confused.
If anyone could shed light on why its not returning it would be greatly appreciated.