Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Alexei Ferreira
13,986 PointsComments.name are not showing and I can not understand why?
Entry.component.ts:
import { Component } from '@angular/core';
@Component({
// kebab Case
selector: 'app-entry',
templateUrl: 'entry.component.html',
styleUrls: ['entry.component.css']
})
export class EntryComponent {
title: string = 'My first Photo';
photo: string = 'http://placehold.it/800x500?text=Angular Basics';
description: string = 'A description of My first Photo';
comments: any[] = [
{ name: "John", comment: "A comment"},
{ name: "Jim", comment: "A comment"},
{ name: "Jen", comment: "A comment"}
]
}
Entry.componemt.html:
<h2>{{title}}</h2>
<figure>
<img src="{{photo}}">
<figcaption>{{description}}</figcaption>
</figure>
<div class="actions">
<button type="button" (click)="isLiked = !isLiked" [ngClass]="{liked: isLiked}">❤</button>
</div>
<div class="comments">
<div class="comment" *ngFor="let commment of comments">
<p><strong>Teste {{comments.name}}</strong>{{comments.comment}}</p>
</div>
</div>
2 Answers

Alexei Ferreira
13,986 PointsThanks. hehehe I found the miss typing.

Yashmin Sainju
3,186 PointsSrs. The same exact problem here. I just named the array commments
Daniel H.J. Chen
12,888 PointsDaniel H.J. Chen
12,888 PointsNote the code:
You are iterating through the "comments" array and assign each item as "commment". But within the loop, you are trying to access properties of "comments". Check your spelling and make sure you are accessing the right variable, then you should be good to go!