I have to make a check in my resolver, if it's fine, I reassign the object, otherwise, I return an observable with the value false.
Here is my code:
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
return this.callApi().subscribe((result) => {
if (blabla === true) {
return Observable.of(result);
}
this.router.navigate([ '/' ]);
return Observable.of(false);
});
}
The Observable.of(false) seems to work, I go to the homepage, but with Observable.of(result) , I don't get the result in my component ...
Thank you for your help
.subscribe(). What's this supposed to do btw?.subscribe()?