Estou recebendo o seguinte erro:
Error: Uncaught (in promise): Error: Template parse errors:
'foto' is not a known element:
1. If 'foto' is an Angular component, then verify that it is part of this module.
2. If 'foto' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message. ("<h1 class="text-center">Alurapic</h1>
[ERROR ->]<foto></foto>"): AppComponent@1:0
Stack trace:
resolvePromise@http://localhost:3000/node_modules/zone.js/dist/zone.js:418:31
resolvePromise@http://localhost:3000/node_modules/zone.js/dist/zone.js:403:17
scheduleResolveOrReject/<@http://localhost:3000/node_modules/zone.js/dist/zone.js:451:17
ZoneDelegate.prototype.invokeTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:225:23
Zone.prototype.runTask@http://localhost:3000/node_modules/zone.js/dist/zone.js:125:28
drainMicroTaskQueue@http://localhost:3000/node_modules/zone.js/dist/zone.js:357:25
ZoneTask/this.invoke@http://localhost:3000/node_modules/zone.js/dist/zone.js:297:25
Já derrubei o servidor e levantei novamente, mas não funcionou.
Seguem meus arquivos:
app/foto/foto.module.ts
import { NgModule } from '@angular/core';
import { FotoComponent } from './foto.component';
@NgModule({
declarations: [ FotoComponent ],
exports: [FotoComponent]
})
export class FotoModule { }
app/foto/foto.component.ts
import {Component} from '@angular/core';
@Component ({
selector : 'foto',
templateUrl : './foto.component.html'
})
export class FotoComponent {}
app/foto/foto.component.html
<img class="img-responsive center-block" src="img/leao.jpg" alt="Leão"/>
app/app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { FotoModule } from './foto/foto.module';
@NgModule({
imports: [ BrowserModule, FotoModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
app/app.component.html
<h1 class="text-center">Alurapic</h1>
<foto></foto>