'router-outlet' is not a known element

后端 未结 12 1349
无人及你
无人及你 2021-01-30 19:36

I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml I ad

12条回答
  •  天命终不由人
    2021-01-30 19:59

    This issue was with me also. Simple trick for it.

     @NgModule({
      imports: [
       .....       
      ],
     declarations: [
      ......
     ],
    
     providers: [...],
     bootstrap: [...]
     })
    

    use it as in above order.first imports then declarations.It worked for me.

提交回复
热议问题