title: how to subscribe to a observable in our .ts file from authguard.ts
body: <p>I have implemented an authguard service in which consist of following void service method.</p>
  <pre><code>loadOrganizations() {
      console.log(&quot;loading organizattions&quot;)
      this.getOrganizations().subscribe(
        (results) =&gt; {
          const organizationList = [];
          if (results.organizations) {
            results.organizations.forEach((element) =&gt; {
              this.appendOrganization(element, organizationList);
              this.loadChildrenOrganization(element.children, organizationList);
            });
          }
          this.organizations$.next(organizationList);
          this.organizations$.complete();
        },
        (error) =&gt; {
          this.organizations$.next([]);
          this.organizations$.complete();
        }
      );
    }
  </code></pre>
  <p>my auth guard service as follows.</p>
  <pre><code>canActivate(
      next: ActivatedRouteSnapshot,
      state: RouterStateSnapshot): Observable&lt;boolean&gt; | Promise&lt;boolean&gt; | boolean {
       this.appService.loadOrganizations();
       console.log(&quot;authuard is calling&quot;)
       return true;
    }
  </code></pre>
  <p>How can I subscribe to a observable in which we get data(from authguard) of organization in another ts file.(within ngOnit??)</p>