我正在使用 Angular 构建一个项目,每当我更改路线时都会收到此错误
Uncaught TypeError: Cannot read property 'ats' of undefined
在控制台中,但应用程序没有崩溃
我在项目中没有任何名为“ats”的内容。
有人知道为什么会这样吗?
这是我的路由模块
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { BrowseComponent } from './browse/browse.component';
import { HomeComponent } from './home/home.component';
const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'browse', component: BrowseComponent },
{ path: '', redirectTo: '/home', pathMatch: 'full' },
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }