title: How to stream a file from node js to angular js
body: <p>I am new in angular and node js. I am trying to send file contents from node to angular. But i can't read it from my angular code</p>
  
  <p>Here is my code</p>
  
  <h1>Node express</h1>
  
  <pre><code>var img = fs.readFileSync('./test.jpg');
       //res.writeHead(200, {'Content-Type': 'image/jpg' });
       //res.end(img, 'binary');
       res.send({'data':img});
       console.log(img);
  </code></pre>
  
  <h1>Angular code is</h1>
  
  <pre><code>&lt;img ng-src="data:image/JPEG;base64,{{image}}"&gt;
  </code></pre>