Javascript – Angular LifeCycle dependency between ngAfterViewInit and observable
enable.service.ts @Injectable({ providedIn: 'root' }) export class EnableService { isEnabled$ = from(this.client.init()).pipe( switchMap(() => this.client.getEnabled()), map(([enabled, isAdmin]) => ({enabled: true, isAdmin: false})), share() ); // not exactly like this but some kind of observable that will return enable and isAdmin…