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 { @Output() doneSignup = new EventEmitter(); signupComplete$: Observable; constructor( private store: Store, ) { } ngOnInit() { this.signupComplete$ = this.store.pipe(select(MemberSignupContainerSelector.selectSignupComplete)); } ngOnDestroy() { } onSignup(info: {member: Member, password: string}) { this.store.dispatch(new MemberEntityStore.Signup(info)); } onDoneSignup() { this.doneSignup.emit(); } }