title: How to make typescript execute code seqentially?
body: <p>my code seems like it doesn't wait for executing some of the code and goes further.</p>
  
  <pre><code>isAdmin(): boolean {
      this.getLoggedUser();
      this.getRole();
      console.log(this.admin);
      console.log('isAdmin');
      return this.admin;
    }
  
    getRole() {
      this.httpClient.get&lt;boolean&gt;('/api/has-role-admin').
      subscribe((data) =&gt; {
      this.admin = data;
      console.log(this.admin);
      console.log('getRole');
      }
      );
   }
  </code></pre>
  
  <p>Console result:</p>
  
  <pre><code>false
  isAdmin
  true
  getRole
  </code></pre>
  
  <p>I want to finish getRole() method and after that step to the rest in isAdmin(). How could I receive that behaviour?</p>