0
我在Angular 2应用程序中创建了一些儿童路线。Angular 2中的空儿童路线
export const AFTER_LOGIN_ROUTES:Routes=[
{path:'',component:LatestPositionComponent},
{path:'add',component:AddNewFriendComponent},
{path:'history',component:HistoryComponent}
];
当我访问http://localhost:4200/app/add或http://localhost:4200/app/history一切都很好。
但在http://localhost:4200/app情况下,我得到了一个错误:
EXCEPTION: Uncaught (in promise): Error: Error in :0:0 caused by: Cannot read property 'firstChild' of null
Error: Error in :0:0 caused by: Cannot read property 'firstChild' of null
at ViewWrappedError.ZoneAwareError
任何想法?
是'道: 'add''一个错字(而不是'' app'')? –
不,“app”有3个孩子。一个空的,'添加'和'历史' –
然后请在你的代码中显示'app'路由。 –