I have only one route in my application so when application starts i want to show route as http://localhost:4200/specialtyQ
for some reason now application is not loading i have below code to achieve that , How i can show correct url ?
app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
const routes: Routes = [{
path: '/specialtyQs',
component: AppComponent
}];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
只需在代码中添加如下所示的路由路径,而不是添加路径即可。
您需要添加一条默认路由来重定向
这将重定向到特定的URL。
你的路线错了