这里我只是创建了两个组件,协商了他们路由切换
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
你的代码肯定有一处是这样调用的
something.showCoverDefault
, 这个something没有取到值,返回undefined, 在代码里仔细找找吧。