title: retrieve array data from api to angular app
body: <p>I'm trying to get an array of data from a local api and display it in my Angular6 App. Getting the content from the api works, but I can't manage to parse the data and output it where i want to.
  I'm searching Google pages up and down for days for that Problem, but somehow no solution seems to work for me (or i'm actually too stupid to implement it the right way :D)
  Hopefully you guys can help me.</p>
  
  <p>API: (( Content = require('./models/content')</p>
  
  <pre><code>app.get('/api/retrieveContent', async (req, res) =&gt; {
  const content = await Content.find({})
  //console.log(content)
  if(!content) {
      res.json({
          status: false,
          message: 'Content does not exist'
      })
      return
  }
  res.json({content}) })
  </code></pre>
  
  <p>Content Model Schema: </p>
  
  <pre><code>const mongoose = require('mongoose')
  
  const ContentSchema = new mongoose.Schema({
      subject: String,
      customer: String,
      task: String,
      date: Date
  })
  
  const Content = mongoose.model('Content', ContentSchema)
  
  module.exports = Content
  </code></pre>
  
  <p>Service:</p>
  
  <pre><code>  getContent(): Observable&lt;mycontent[]&gt; {
      return this.http.get&lt;mycontent[]&gt;('/api/retrieveContent')
        .pipe(tap(data =&gt; JSON.stringify(data as mycontent[])))
    }
  </code></pre>
  
  <p>content.ts file (containing my mycontent Model):</p>
  
  <pre><code>export interface mycontent {
      status: boolean,
      subject: string,
      customer: string,
      task: string,
      date: string,
      id: string
  }
  </code></pre>
  
  <p>Component (in ngOnInit()) (Im initializing contents as an array earlier in that component) :</p>
  
  <pre><code>  this.contentServ.getContent()
        .subscribe(data =&gt; this.contents = data)
  </code></pre>
  
  <p>And finally im trying to output in my component.html file:</p>
  
  <pre><code>  &lt;ul *ngFor="let content of contents"&gt;
      &lt;li&gt; {{content.subject}} &lt;/li&gt;
      &lt;li&gt; {{content.customer}} &lt;/li&gt;
      &lt;li&gt; {{content.task}} &lt;/li&gt;
      &lt;li&gt; {{content.date}} &lt;/li&gt;
      &lt;li&gt; {{content.id}} &lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>