comment.component.ts:
import { Component, OnInit } from \'@angular/core\';
import { Router} from \'@angular/router\'
import { Comment } from
Try adding the ngFor in the ul tag
- {{comment.Name}}
`
or
- {{comment.Name}}
`
also maybe you have not pasted your entire code, i don't see a injection of the service component.
you will need to import and inject the service in the component that you want to use it in. In the component constructor
import {CommentService} from '../path to service'
constructor(private commentService: CommentService)
{
//you can call the getcomments service here itself or in ngOnInit
this.commentService.getComments().subscribe(data =>
{
console.log(data)
}
} //end constructor
Hopefully you have tested that your commentService is returning data via console.log