Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular return observable with error

import { throwError } from 'rxjs';

// ...
method(): Observable<SomeClass> {
  // ...
  // from the 
  if (failedCondition) {
    return throwError('');
  }
  // ...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #return #observable #error
ADD COMMENT
Topic
Name
1+5 =