I Want to return boolean value (only true or false) where my function's return type is Observable < boolean >. How can I return only true or false value in using angular 2. I am trying a lot but unable to solve this problem. How can I do it?
Below is my code :
CheckValidation(measurementUnitId: string, itemId: string): Observable<boolean> {
const url = `api/v1.0/measurementUnits/${measurementUnitId}/items/${itemId}`;
debugger;
var returnValue = this.http.get(url)
.do(result => console.log('CheckValidation: ' + result))
.catch(this.handleError);
//Here I need the value of returnValue variable will be true or false.
}
Thanks in advance.