This is my Page-datail.component.ts
export class PageDetailComponent implements OnInit {
private apiUrl="http://localhost:3000/pages"
pages={};
// data={};
constructor(private route:ActivatedRoute,private page:PageService,private router: Router,private http:Http) { }
ngOnInit() {
this.getpage(this.route.snapshot.params['title']);
// this.getPages();
// this.getData();
}
getpage(title) {
this.page.getPage(title)
.subscribe(pages => {
console.log(pages);
this.pages = pages;
}, err => {
console.log(err);
});
}
This is the response I am getting in the Console. I am getting this Object Object Error and it fails to render it in html.
<a *ngFor="let p of pages" class="list-group-item list-group-item-action">
{{p.title}}
</a>
This is the response I am getting in the console