[Angular] The AppComponent class is a standalone component, which can not be used in the @NgModule.bootstrap array. Use the bootstrapApplication function for bootstrap instead
W starszych wersjach tworzony komponent musiał być zadeklarowany w NgModule, aby można było użyć go w szablonie innego komponentu. W klasycznym podejściu do organizacji komponentów w Angularze tworzymy tak jak pokazano poniżej: import { Component } from '@angular/core'; @Component({ selector: 'app-hello', template: `<h1>Hello, {{ name }}</h1>`, }) export class HelloComponent { name: string = 'World'; } Następnie w app.module.ts musimy zadeklarować komponent: import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { HelloComponent } from './hello.component'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent, HelloComponent, // Deklarujemy nasz komponent ], imports: [ BrowserModule ], bootstrap: [AppComponent] // Wskazujemy główny komponent do inicjalizacji }) export class AppModule { } Prz...