import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import {NavabrComponent} from './navber/navbar.component';
const routes: Routes = [
{path: '' redirectTo: '/home', pathMatch:'full'},
{path: 'home', component:HomeComponent}
];
@NgModule({
imports: [
CommonModule,
RouterModule.forRoot(routes, { useHash: true })
],
exports:[RouterModule],
declarations: []
})
export class AppRoutingModule { }
我的网页上发生了一些变化,它运行了服务器 --> src/app/app-routing.module.ts(10,11) 中的错误:错误 TS1005:',' expected.it will be displayed 每次运行元素都会出现这个错误,请问如何解决?
最佳答案
这一行缺少逗号
{path: '', redirectTo: '/home', pathMatch:'full'},
关于javascript - src/app/app-routing.module.ts(10,11) : error TS1005: ',' expected 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51435520/