comment.component.ts:
import { Component, OnInit } from \'@angular/core\';
import { Router} from \'@angular/router\'
import { Comment } from
Try this
template:
comments: Observable;
ngOnInit() {
this.comments = this.getComments();
}
getComments() {
return this.commentService.getComments();
}
I see 2 problems in your code 1. You call map without returning any value. 2. You try to set values inside map instead of subscribe but the values was undefined once it reach subscribe in your ngOnInit