简体   繁体   中英

Angular material MatDialog.open(Component) automatically selects first link of Component

Angular material matdialog.open(OrderComponent) automatically selects first link of OrderComponent(which is defined in app-routing.module.ts),but i want to navigate to “/order/edit/:id” which is a second child link of OrderComponent. app.routing.module.ts:

 {
        path: 'order', children: [
          { path: '', component: OrderComponent },
          { path: 'edit/:id', component: OrderComponent }
        ]
      }

您不能使用matdialog更改路由器,但是在这种情况下,您可以根据数据更改将数据发送到matdialog ,您可以在matdialog内执行任何ordercomponent

matdialog.open(OrderComponent, { data: {editId: "youruniqueid" } });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM