Given the following route:
path: \'\',
component: MyComponent,
resolve: {
foo: FooResolver,
bar: BarResolver
}
Is there any way of tell
I found a slightly more elegant solution that can be used if you don't care about the results from all of the resolvers:
class FooBarResolver implements Resolve> {
constructor(
protected fooResolver: FooResolver,
protected barResolver: BarResolver
) { }
resolve(): Observable
{
return this.fooResolver.resolve().pipe(
concat(this.barResolver.resolve()),
concat(this.barResolver.resolve())
);
}
}
I use this to trigger the data loading in my services. And because they write the data / isLoading / error into an Akita storage, I don't care about the results of the resolvers.