Trying to Subscribe to a method that returns an Observable in Angular

Advertisements I have a method that returns an Observable: clockOut(): Observable<boolean> { let isClockedOut = new Subject<boolean>(); isClockedOut.next(false); // Some code to clock out and return x if (x === true) { isClockedOut.next(true); } return isClockedOut.asObservable(); } And I’m calling/subscribing to the clockOut() method like so: ngOnInit() { this.clockOut().subscribe((didClockOut: boolean) => { if (didClockOut ===… Read More Trying to Subscribe to a method that returns an Observable in Angular