title: Tabular representation of mongodb database with express and angular
body: <p>I want to display the mongodb data in the form of table in html with node.js, express.js and angular.js.</p>
  
  <p>What I am doing now is something like this</p>
  
  <p>route.js</p>
  
  <pre><code>app.get('/superhero', function(req, res) {
      superhero.superhero_list(req,res); 
      res.sendfile('./public/superhero.html');
  });
  </code></pre>
  
  <p>superhero.js</p>
  
  <pre><code>var express = require ('express')
  var rootRequire = require('root-require');
  var bodyParser = require('body-parser');
  var superheroSchema = rootRequire('Anguar/models/superhero');
  module.exports = {
  superhero_list: function(req, res) {
          superheroSchema.find({}, function(err, superhero) {
              if (err) {
                  return res.status(400).send({ "message": "Server error!", "err": err });
              }
              else {
                  return res.status(200).send({ "superheros": superhero });
              }
  }
  };          
  </code></pre>
  
  <p>superhero.html</p>
  
  <pre><code>&lt;h1&gt; Super heros&lt;/h1&gt;
  
  &lt;table&gt;
          &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;S.no&lt;/th&gt;
              &lt;th&gt;Super hero&lt;/th&gt;
              &lt;th&gt;Status&lt;/th&gt;
              &lt;th&gt;Action&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;tr&gt;
          // to implement the table 
          &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Problem I am facing is the response of the </p>
  
  <blockquote>
  <pre><code>return res.status(200).send({ "superheros": superhero });
  </code></pre>
  </blockquote>
  
  <p>is directly giving me response </p>
  
  <blockquote>
    <p>{"Superheros":[{"_id":"582c5211c8a8e06c0849a238","name":"Superman"},{"_id":"583bf729a9de83840ca277dc","name":"Spiderman"},{"_id":"583bf78ca9de83840ca277de","name":"Batman"},{"_id":"583bf793a9de83840ca277df","name":"Shaktiman"},{"_id":"583bfc97a9de83840ca277e0","name":"Me"}]}</p>
  </blockquote>
  
  <p>and not loading the superhero.html </p>
  
  <p>how to get data into html?</p>