未捕获的类型错误:无法读取未定义的属性“ats”

时间:2021-04-28 11:47:25

标签: angular typeerror

我正在使用 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 { }

This is the error from the Chrome console

0 个答案:

没有答案