Open Alex7-tr opened 3 years ago
nel file: app-routing.module.ts mancano gli import dei componenti:
import {FirstComponent} from './first/first.component';
import {SecondComponent} from './second/second.component';
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
se non importi una classe non puoi utilizzarla, lo esige typescript: https://www.typescriptlang.org/docs/handbook/modules.html
sempre nel file: app-routing.module.ts fia uso del componente: PageNotFoundComponent non trovo traccia di questo componente, devi crearlo.
nel file: app.module.ts devi aggiungere i componenti che hai creato nell'attributo 'declarations':
...
@NgModule({
declarations: [
AppComponent,
PageNotFoundComponent,
FirstComponent,
SecondComponent
],
...
facciamo chiarezza (almeno proviamoci): i componenti sono
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component'; // <<=== IMPORTAZIONE CLASSE
@NgModule({ declarations: [AppComponent], // <<== DICHIARAZIONE COMPONENTE imports: [BrowserModule], providers: [], bootstrap: [AppComponent] }) export class AppModule {}
ora passiamo ad errori presenti neI file FirstComponent E SecondComponent:
... export class ???????? implements OnInit {
name; // <=== MANCA QUESTO ATTRIBUTO .... ngOnInit(): void { this.route.queryParams.subscribe(params => { this.name = params['name']; // <=== IN QUESTO PUNTO NE FAI USO }); }
} ...
dopo averli corretti controlla nel tutorial dove venivano indicati questi passaggi.
fai sapere.
ciao luca, ho provveduto alla correzione. spero sia corretto (non ho trovato l'attributo "name" che mi serve).
ciao, l'atributo "name" avresti dovuto crearlo. quindi ti funziona tutto?
ah ok...pensavo dovessi trovarlo anche nel codice del tutorial. si non mi da errori.
Ciao Luca, ho pushato e committato al primo errore come mi hai suggerito.
attendo tue notizie