Angular CLI not sending Mongodb Array to view when I preform a get request to my DB

James Brett Source

So I have a component making a git request to my MongoDB and mongoose schema. I can get the array information to console log but am having trouble figuring out how to "append the view" with the data.

article-list.component:

article: any;

constructor(private http: HttpClient) { }

ngOnInit() {
  this.http.get('/article').subscribe(data => {
  this.article = data;
  console.log(data);

article-list.html:

<ul *ngFor="let article of articles">
 <li>{{article.image}}</li>
 <li>{{article.title}}</li>
 <li>{{article.about}}</li>
 <li>{{article.article}}</li>
</ul>
angularmongodb

Answers

comments powered by Disqus