Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Angular Basics Angular Components Component Templates and Styles

Link to photo not working

Here is my code:

import { Component } from '@angular/core';

@Component({
    selector: 'app-entry',
    templateUrl: './entry.component.html',
    styleUrls: ['./entry.component.css']
})
export class EntryComponent {
    public title: string = 'My First Photo';
    public photo: string = 'http://placeholder.it/800x500?text=Angular Basics';
    public description: string = 'A Description of My First Photo';

}
<h2>{{title}}</h2>
<figure>
    <img src="{{photo}}" />
    <figcaption>{{description}}</figcaption>
</figure>

And this is what I get in the console:

GET http://placeholder.it/800x500?text=Angular%20Basics 404 (Not Found)

1 Answer

Adam Pengh
Adam Pengh
29,881 Points

The URL is wrong. If you put it in the browser, it returns 404. The domain is placehold.it, not placeholder.it http://www.placehold.it/800x500?text=Angular%20Basics