Routing fails to navigate to pages

Discussão em 'Angular' iniciado por SusieStaur, Dezembro 17, 2024.

  1. SusieStaur

    SusieStaur Guest

    I am trying to get links working in a new installation I have and it is not working. I can see the links to the two different pages but they do not work. I can manually type in the page name and it takes me to the other page but the links do not take me to the different pages.

    import { Routes } from '@angular/router';
    import { HomeComponent } from './home/home.component';
    import { TeamComponent } from './team/team.component';

    export const routes: Routes = [
    { path: '', redirectTo: '/home', pathMatch: 'full' },
    { path: 'home', component: HomeComponent },
    { path: 'team', component: TeamComponent }

    ];

    import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
    import { provideRouter } from '@angular/router';
    import { routes } from './app.routes';
    import { provideClientHydration, withEventReplay } from '@angular/platform-browser';

    export const appConfig: ApplicationConfig = {
    providers: [
    provideZoneChangeDetection({ eventCoalescing: true }),
    provideRouter(routes),
    provideClientHydration(withEventReplay())
    ]
    };

    import { bootstrapApplication } from '@angular/platform-browser';
    import { appConfig } from './app/app.config';
    import { AppComponent } from './app/app.component';
    /**import { provideRouter } from '@angular/router';
    import { routes } from './app/app.routes';*/

    bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err));

    /**providers: [
    provideRouter(routes)
    ]*/

    Continue reading...

Compartilhe esta Página