Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
export class AstronautComponent extends BaseComponent {
@Input() astronaut: string;
mission = '<no mission announced>';
confirmed = false;
announced = false;
constructor(private missionService: MissionService) {
super();
missionService.missionAnnounced$
.takeUntil(this.destroyed$)
.subscribe(
mission => {
this.mission = mission;
this.announced = true;
this.confirmed = false;
});
}
confirm() {
this.confirmed = true;
this.missionService.confirmMission(this.astronaut);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment