title: How to set the value for an external variable from the response via .subscribe()
body: <p>I faced with difficulties for getting values from async queries using Observable in Angular 5</p>
  
  <pre><code>export class CustomComponent {
  private external: any;
  
  constructor(private http: HttpClient) {}
  
  getContent() {
       return this.http.get('api/conten/get');
  }
  
  
  retrieve() {
      this.getContent().subscribe(content =&gt; {
          this.external = content;
          console.log(this.external) // here we get content that we expect
      });
  
      console.log(this.external); // there is 'undefined'
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How can I set <strong>external</strong> variable with result from <strong>getContent()</strong>?
  Probably there are other ways?<br>
  I guess this situation very frequent when we need to use response in code bellow<br>
  Please, give example how can I get value from response immediately after request(e.g. make request sync within the framework of Angular)  </p>