ing
This commit is contained in:
parent
9730a00827
commit
a81dca3232
|
@ -3,7 +3,7 @@
|
||||||
<a class="redirect" [routerLink]="['/auth/signup']">Register an account</a>
|
<a class="redirect" [routerLink]="['/auth/signup']">Register an account</a>
|
||||||
</mat-card-title>
|
</mat-card-title>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<form fxLayout="column" fxLayoutAlign="start stretch" [formGroup]="signinForm" (ngSubmit)="login()">
|
<form fxLayout="column" fxLayoutAlign="start stretch" [formGroup]="signinForm" (ngSubmit)="signin()">
|
||||||
<mat-form-field class="full-width">
|
<mat-form-field class="full-width">
|
||||||
<input type="email" id="email" class="input" placeholder="Please enter your email"
|
<input type="email" id="email" class="input" placeholder="Please enter your email"
|
||||||
formControlName="email" required matInput>
|
formControlName="email" required matInput>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
{{ formErrors.password }}
|
{{ formErrors.password }}
|
||||||
</div>
|
</div>
|
||||||
<!--[disabled]="!signinForm.valid"-->
|
<!--[disabled]="!signinForm.valid"-->
|
||||||
<button mat-raised-button color="accent" type="submit" (click)="signin()">log in</button>
|
<button mat-raised-button color="accent" type="submit">Sign In</button>
|
||||||
</form>
|
</form>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Router } from '@angular/router';
|
||||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
|
|
||||||
import * as AuthStore from '../store/auth';
|
import * as AuthStore from '../../store/auth';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'of-member-signin',
|
selector: 'of-member-signin',
|
||||||
|
@ -22,7 +22,9 @@ export class SigninComponent implements OnInit {
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private store: Store<AuthStore.State>,
|
private store: Store<AuthStore.State>,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
) { }
|
) {
|
||||||
|
console.log(this.store);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.initForm();
|
this.initForm();
|
||||||
|
@ -52,7 +54,8 @@ export class SigninComponent implements OnInit {
|
||||||
signupBtnClick() {
|
signupBtnClick() {
|
||||||
this.router.navigateByUrl('/auth/signup');
|
this.router.navigateByUrl('/auth/signup');
|
||||||
}
|
}
|
||||||
login() {
|
signin() {
|
||||||
console.log('signin component login fnc');
|
this.store.dispatch(new AuthStore.Signin(this.signinForm.value));
|
||||||
|
console.log('signin component signin fnc');
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
export const MODULE = {
|
export const MODULE = {
|
||||||
name: 'Member'
|
name: 'member'
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,10 +5,10 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import { MaterialModule } from 'app/commons/ui/material/material.module';
|
import { MaterialModule } from 'app/commons/ui/material/material.module';
|
||||||
|
|
||||||
import { ModifyComponent } from './component/modify.component';
|
import { ModifyComponent } from './component/modify/modify.component';
|
||||||
import { SigninComponent } from './component/signin.component';
|
import { SigninComponent } from './component/signin/signin.component';
|
||||||
import { SignupComponent } from './component/signup.component';
|
import { SignupComponent } from './component/signup/signup.component';
|
||||||
import { ResetPasswordComponent } from './component/reset-password.component';
|
import { ResetPasswordComponent } from './component/reset-password/reset-password.component';
|
||||||
import { MemberService } from './service/member.service';
|
import { MemberService } from './service/member.service';
|
||||||
import { AuthGuard } from './guard/auth.guard';
|
import { AuthGuard } from './guard/auth.guard';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user