Angular desde cero (2024) | 2.5 - Módulos
Freddy Daniel Alcarazo Ibáñez@freddydanielalcarazoibanez
Contenido de app.module.ts
import { NgModule } from [@ [@'@angular](https://ed.team/u/'@angular)](https://ed.team/u/'@angular)/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { CardComponent } from './card/card.component';
import { CardDetailComponent } from './card/card-detail/card-detail.component';
import { CalculatorModule } from './calculator/calculator.module';
[@
@NgModule](https://ed.team/u/
@NgModule)({
declarations: [
AppComponent,
CardComponent,
CardDetailComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
CalculatorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Sale un desmadre en la consola:
D:\Software\web\Angular\my-first-app(master)
λ ng s -o
Application bundle generation failed. [1.072 seconds]
X [ERROR] NG8001: 'app-calculator' is not a known element:
1. If 'app-calculator' is an Angular component, then verify that it is part of this module.
2. If 'app-calculator' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the [@'@NgModule.schemas](https://ed.team/u/'@NgModule.schemas)' of this component to suppress this message. [plugin angular-compiler]
src/app/app.component.html:15:0:
15 │ <app-calculator [title] = "message" (emitter)="getSumNumberResult(...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component AppComponent.
src/app/app.component.ts:5:15:
5 │ templateUrl: './app.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] NG5: Argument of type 'Event' is not assignable to parameter of type 'number'. [plugin angular-compiler]
src/app/app.component.html:15:66:
15 │ ..."message" (emitter)="getSumNumberResult($event)"></app-calculator>
╵ ~~~~~~
Error occurs in the template of component AppComponent.
src/app/app.component.ts:5:15:
5 │ templateUrl: './app.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~
X [ERROR] NG8002: Can't bind to 'ngModel' since it isn't a known property of 'input'. [plugin angular-compiler]
src/app/card/card.component.html:3:19:
3 │ <input type="text" [(ngModel)]="cardData.title"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component CardComponent.
src/app/card/card.component.ts:5:15:
5 │ templateUrl: './card.component.html',
╵ ~~~~~~~~~~~~~~~~~~~~~~~
Watch mode enabled. Watching for file changes...
Escribe una respuesta