Angular2 router (@angular/router), how to set default route?

后端 未结 10 1997
广开言路
广开言路 2020-12-02 15:07

How can I set a default route in my @Routes route metadata collection? If you use the angular2 router from @angular/router-deprecated you define the routes in @routeConfig

10条回答
  •  抹茶落季
    2020-12-02 15:34

    according to documentation you should just

    { path: '**', component: DefaultLayoutComponent }
    

    on your app-routing.module.ts source: https://angular.io/guide/router

提交回复
热议问题