Last active
June 6, 2017 10:22
-
-
Save pgiemza/bf621529d69b73f8b374c88900b1ee4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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