Angular 2 throwing error: Outlet is not activated

后端 未结 4 1145
我寻月下人不归
我寻月下人不归 2021-02-12 22:21

I have set up my app so that I have a Recipe Book which has a list of Recipies which when I click on a Recipe it then shows the Recipe Details

4条回答
  •  清酒与你
    2021-02-12 22:59

    This route is invalid and you should get an error for it.

    { path: '' },
    

    A route either needs to have a component, a redirectTo, or children.

    If an empty path route has no children it also should have pathMatch: 'full'.

    I guess what you want is

    { path: '', component: DummyComponent, pathMatch: 'full' },
    

    Where DummyComponent is a component with an empty view. You can reuse the same DummyComponent for all these paths.

提交回复
热议问题