Olá,
Não consigo compreender o motivo do erro, poderiam me auxiliar?
Olá,
Não consigo compreender o motivo do erro, poderiam me auxiliar?
Olá Elisangela,
Você pode enviar o código do arquivo app.module.ts
e do home.component.ts
por favor?
1 - app.module
import { HomeModule } from './home/home.module';
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HomeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
2- home.component.ts Present in the NgModule.exports of HomeModule but neither declared nor imported (-996004)
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
Elisangela,
No arquivo home.module.ts
, faltou a importação do HomeRoutingModule
. Deve estar assim:
@NgModule({
declarations: [HomeComponent],
imports: [
CommonModule,
HomeRoutingModule
],
exports: [HomeComponent],
})
export class HomeModule { }
No app.module.ts
, nas declarações, você deve retirar a declaração do HomeComponent
. Deve estar assim:
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HomeModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Veja se com essas alterações já consegue resolver o problema, ok?
`
Compiled with problems:X
ERROR
src/app/home/login/login.component.html:5:74 - error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'.
5 <input type="text" class="form-control" placeholder="Nome do usuário"[(ngModel)]="usuario" name="usuario">
~~~~~~~~~~~~~~~~~~~~~
src/app/home/login/login.component.ts:7:16 7 templateUrl: './login.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component LoginComponent.
ERROR
src/app/home/login/login.component.html:5:87 - error TS2322: Type 'Event' is not assignable to type 'string'.
5 <input type="text" class="form-control" placeholder="Nome do usuário"[(ngModel)]="usuario" name="usuario">
~~~~~~~~~~~~~~~
src/app/home/login/login.component.ts:7:16 7 templateUrl: './login.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component LoginComponent.
ERROR
src/app/home/login/login.component.html:8:69 - error NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'.
8 <input type="password" class="form-control" placeholder="Senha" [(ngModel)]="senha" name="senha">
~~~~~~~~~~~~~~~~~~~
src/app/home/login/login.component.ts:7:16 7 templateUrl: './login.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component LoginComponent.
ERROR
src/app/home/login/login.component.html:8:82 - error TS2322: Type 'Event' is not assignable to type 'string'.
8 <input type="password" class="form-control" placeholder="Senha" [(ngModel)]="senha" name="senha">
~~~~~~~~~~~~~
src/app/home/login/login.component.ts:7:16
7 templateUrl: './login.component.html',
~
Error occurs in the template of component LoginComponent.
`
!
Insira aqui a descrição dessa imagem para ajudar na acessibilidade
Oi Elisangela, vi que você já avançou no projeto.
Em qual aula do curso você está atualmente? Para eu conseguir te mandar o código atualizado.
05 Redirecionando a rota