I'm creating a simple Angular project with two components: home and submit. My app-routing.module.ts look like this:
import { NgModule } from '@angular/core';
import { Routes, RouterModule, ActivatedRoute } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { SubmitComponent } from './submit/submit.component';
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'submit', component: SubmitComponent },
{ path: '', redirectTo: '/home', pathMatch: 'full' }
];
@NgModule({
imports: [ RouterModule.forRoot(routes) ],
exports: [ RouterModule ]
})
export class AppRoutingModule { }
In my browser if I change the path to /submit the page looks like it reloads and then defaults back to /home. I have already tried changing the path: '' to path: '**'. It does not navigate to the submit component. Any ideas what I am doing incorrectly?
Angular 8.2.14 Google Chrome
<base href="/">added in your index.html head?