angular报错:Cannot read property 'showCoverDefault' of undefined
这里我只是创建了两个组件,协商了他们路由切换
app-component.html文件:
<a [routerLink]="['/']">主页</a>
<a [routerLink]="['/product']">商品详情</a>
<router-outlet></router-outlet>
app-routing.module.ts文件:
const routes: Routes = [
{
path: '',component:HomeComponent
},
{
path: 'product',component:ProductComponent
}
];
这个报错并没有影响我的项目功能效果,但是很奇怪为什么会报错,而且……此时你正在观看的这个页面(思否网)好像也有这个报错。。。
备注:使用的是VSCode编译环境,Chrome浏览器,Win10系统64位,angular5,NodeJS版本8.11.2,angular-cli版本1.7.4
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的代码肯定有一处是这样调用的
something.showCoverDefault
, 这个something没有取到值,返回undefined, 在代码里仔细找找吧。