Skip to content

Instantly share code, notes, and snippets.

@pgiemza
Last active June 6, 2017 10:22
Show Gist options
  • Save pgiemza/bf621529d69b73f8b374c88900b1ee4c to your computer and use it in GitHub Desktop.
Save pgiemza/bf621529d69b73f8b374c88900b1ee4c to your computer and use it in GitHub Desktop.
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