title: convert text to html format in angular
body: <p>I am creating post request with promise, using angular 6. In my service I created 
  a request function which looks like this: </p>
  
  <pre><code>sendRequest() {
  let promise = new Promise((resolve, reject)=&gt;{
    this.http.post(this.url, this.params, {responseType: 'text'}).toPromise()
    .then(res =&gt;{
      this.data = res;
      this.router.navigateByUrl('1/success'); // I want to show res code on this page
      resolve();
    },
    error =&gt; {
      this.data = error;
      this.router.navigateByUrl('1/fail');
      reject(error);
    } 
  )
  return promise;
  })}
  </code></pre>
  
  <p>res returns text in html format like that:</p>
  
  <p><code>&lt;html&gt;
    &lt;head&gt;
      some code
    &lt;/head&gt;
    &lt;body&gt;
      code i need
    &lt;/body&gt;
  &lt;/html&gt;
  </code>, which is fine, but I would like to use that text as html code on success/fail page. Specifically, everything that is in body tag. How can i achieve that? If i use anything like</p>
  
  <pre><code>&lt;div [innerHTML]="res"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>{{res}}
  </code></pre>
  
  <p>it just returns plain text.</p>