angular - 未捕获的类型错误:无法读取未定义的属性“ats”
问题描述
我正在使用 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 { }
解决方案
推荐阅读
- javascript - 在渲染方法中未定义 React js 对象属性
- laravel - 如何仅在用户登录时才显示元素 onclick onclick 如果未使用 Laravel 重定向到登录
- c# - iText7 (PdfSweep):System.ArgumentException:CharacterRenderInfo 对象表示单个字符
- c# - 如何从具有多个相关表的单个查询中获取数据集结果?
- xpath - 相同元素的 xpath 不同
- php - wordpress 主题的两个侧边栏
- facebook - 反应原生 fbsdk 我如何通过服务器获得长期访问令牌
- android - 为什么从 Google Places API 收到的语言环境始终为空
- batch-file - 如何将所有文件名重命名为不同子文件夹中的相同?
- c# - 单例上的 StackOverflowException