47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import {
|
|
Component, EventEmitter,
|
|
OnInit,
|
|
Output
|
|
} from '@angular/core';
|
|
import {select, Store} from '@ngrx/store';
|
|
|
|
import * as MemberEntityStore from '../store/entity/member';
|
|
import { Observable } from 'rxjs';
|
|
import { Member } from '@overflow/commons-typescript/model/member';
|
|
import { MemberResetPasswordContainerSelector } from '../store';
|
|
|
|
@Component({
|
|
selector: 'of-member-reset-password-container',
|
|
templateUrl: './member-reset-password-container.component.html',
|
|
})
|
|
export class MemberResetPasswordContainerComponent implements OnInit {
|
|
@Output() signin = new EventEmitter();
|
|
@Output() signup = new EventEmitter();
|
|
|
|
member$: Observable<Member>;
|
|
pending$: Observable<boolean>;
|
|
error$: Observable<any>;
|
|
|
|
constructor(
|
|
private store: Store<any>,
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.member$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectMember));
|
|
this.pending$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectPending));
|
|
this.error$ = this.store.pipe(select(MemberResetPasswordContainerSelector.selectError));
|
|
}
|
|
|
|
resetPassword(email: string) {
|
|
this.store.dispatch(new MemberEntityStore.ResetPassword(email));
|
|
}
|
|
|
|
onSignin() {
|
|
this.signin.emit();
|
|
}
|
|
|
|
onSignup() {
|
|
this.signup.emit();
|
|
}
|
|
}
|