Boa noite!
Após fazer o exercício, tive o erro abaixo no console do navegador e nada foi renderizado:
GET http://localhost:4200/null 404 (Not Found)
Segue códigos que abaixo.
photo.component.ts:
import { Component } from '@angular/core';
@Component({
selector: "ap-photo",
templateUrl: "photo.component.html"
})
export class PhotoComponent{
description = "World of Warcraft";
url = "https://vignette.wikia.nocookie.net/wowadventure/images/3/35/World_of_Warcraft_Icon_by_Onix9.png/revision/latest?cb=20131111210301";
}
Photo.component.html:
<img class="img-thumbnail" [src]="url" [alt]="description">
app.component.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { PhotoComponent } from './photo/photo.component';
@NgModule({
declarations: [
AppComponent,
PhotoComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Estou utilizando as seguintes configurações de software:
Linux Mint 19.1
Visual Studio Code 1.30.2
Angular CLI 7.2.1
Node.js 11.6.0