1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

NG8001: 'app-welcome' is not a known element:

Discussão em 'Angular' iniciado por ohchch, Setembro 16, 2025.

  1. ohchch

    ohchch Guest

    I've encountered an issue with my Angular application, and I'm getting error 8001. I'm not sure how to handle it. Can anyone help me with this? Thank you!

    app.component.html

    <h1>{{ title }}</h1>
    <p>Congratulations! Your app is running. </p>
    <app-welcome></app-welcome>


    app.component.ts

    import { Component } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { RouterOutlet } from '@angular/router';

    @Component({
    selector: 'app-root',
    standalone: true,
    imports: [CommonModule, RouterOutlet],
    templateUrl: './app.component.html',
    styleUrl: './app.component.css'
    })
    export class AppComponent {
    title = 'XYZCARS';
    }



    welcome.component.ts

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

    @Component({
    selector: 'app-welcome',
    templateUrl: './welcome.component.html',
    styleUrl: './welcome.component.css'
    })
    export class WelcomeComponent {
    car = 'toyota';
    }



    My project initially did not have an app.module.ts file. I added it myself and configured it based on some information I found online, but the issue persists and remains unresolved. Can anyone help me with this?

    app.module.ts

    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    import { WelcomeComponent } from './welcome/welcome.component';

    import { AppComponent } from './app.component';

    @NgModule({
    declarations: [
    AppComponent,
    WelcomeComponent
    ],
    imports: [
    BrowserModule
    ],
    providers: [],
    bootstrap: [AppComponent]
    })
    export class AppModule { }

    Continue reading...

Compartilhe esta Página