title: Instead of ngOnint of the app.component, where to put the api call which makes the system wait until the response is retuned & injected into the body?
body: <p>I am new to angular and trying out different things. Recently I stumbled upon an issue that needs me to take some actions based on the results being returned by the k but before anything loads in the application.</p>
  <p>Right now I am calling a <code>webapi</code> in the kof the <code>app.component.ts</code>, and based on that I am hiding the contents in the website but recently I noticed a slow response from the server that caused a slow response from the <code>webapi</code> hence the actions that needed to be taken are delayed hence not hiding the content.</p>
  <p>Now, instead of the of the <code>app.component</code> where I am calling the api which returns promise and then inject the result into the <code>css</code> of the body's kI need to put the api call somewhere until the result is returned the system should not proceed.</p>
  <p>update:</p>
  <p>ngOninit() of the app.component, we have called an api that basically returns the true/false. Based on that, 'type' a class is injected into the document.body i.e. IsVisible. And in the Sass of app.component it disables the logos and other contents in the web page.</p>
  <p>api call</p>
  <pre><code>const res= app.services.getIsActiveType().toPromise();
  document.body.ClassList.Add(res.type);
  </code></pre>
  <p>in sass</p>
  <pre><code>body {
    &amp;.Type{
      logos {
        dispaly: none;     
      }
     }
    }
  </code></pre>