member_webapp/@overflow/member/container/member-signup-container.component.ts
2018-05-29 20:42:39 +09:00

37 lines
892 B
TypeScript

import {
Component, EventEmitter,
OnDestroy,
OnInit, Output,
} from '@angular/core';
import { Member } from '@overflow/commons-typescript/model/member';
import {select, Store} from '@ngrx/store';
import * as MemberEntityStore from '../store/entity/member';
import { MemberSignupContainerSelector } from '../store';
import { Observable } from 'rxjs';
@Component({
selector: 'of-member-signup-container',
templateUrl: './member-signup-container.component.html',
})
export class MemberSignupContainerComponent implements OnInit, OnDestroy {
member$: Observable<Member>;
constructor(
private store: Store<any>,
) { }
ngOnInit() {
this.member$ = this.store.pipe(select(MemberSignupContainerSelector.selectMember));
}
ngOnDestroy() {
}
onSignup(info: {member: Member, password: string}) {
this.store.dispatch(new MemberEntityStore.Signup(info));
}
}