title: Angular7: unable to set {responseType: 'text'}
body: <p><strong>Scenario</strong>: 
  Upon an API call from Angular7, i am calling Node (via express) and returning chunked data of type string - I want to capture this string data and display it as string</p>
  
  <p><strong>Server-side:</strong>
  From Node backend, the data is being sent is 'text' and not json... the data is sent via multiple res.write('some strings') statements</p>
  
  <p><strong>client-side in Angular:</strong>
  I want an observable to process this data... </p>
  
  <ol>
  <li>when i don't mention any responseType [return this.http.get(this.streamURL );]... i get error:</li>
  </ol>
  
  <blockquote>
    <p>SyntaxError: Unexpected token { in JSON at position 12
        at JSON.parse ()</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/kTMvX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kTMvX.png" alt="the error on stackBlitz and similar error at compile time on ng serve"></a></p>
  
  <ol start="2">
  <li>when i don't mention responseType as 'text [return this.http.get(this.streamURL , { responseType: 'text'});]... i get error at compile time:</li>
  </ol>
  
  <blockquote>
    <p>ERROR in src/app/myS.service.ts(24,54): error TS2322: Type '"text"' is
    not assignable to type '"json"'</p>
  </blockquote>
  
  <p>how can i capture 'text' data from my Node JS backend... i am using npm cors in my Node so no CORS errors there</p>
  
  <p><strong>Demo code</strong> available here: <a href="https://stackblitz.com/edit/angular-44sess" rel="noreferrer">https://stackblitz.com/edit/angular-44sess</a></p>
  
  <p>My <strong>Back-end</strong> is in the snippet below:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>app.get('/obs/responseWrite', cors(), function(req, res){
    var j=0;
    
    const headers = { 
      'Content-Type': 'text',     
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Methods': 'OPTIONS, POST, GET',
      'Access-Control-Max-Age': 2592000, // 30 days
    };
    res.writeHead(200,headers);
    
    for(var i=0; i&lt;50000; i++){
      /* setInterval(function() {    res.write("returning j:["+ j + "]. "); j=j+1; if(j&gt;=100){res.end();} }, 1000); */
      var myObj =  { return : i };
      var myStr= JSON.stringify(myObj);
      console.log(myStr);
      res.write(myStr);
    }
    setInterval(function() {    res.end(); }, 15000);
    
  });</code></pre>
  </div>
  </div>
  </p>