导航到其他路线

时间:2017-01-12 08:47:28

标签: angular dart angular-dart

是否可以像在ajax调用之后那样路由到另一个页面? 所以我知道在Angular2 TS中使用html是可能的,但它是否适用于Dart以及如何使用?

@RouteConfig(const [ 
  const Route(path: '/search', name: 'Search', component: SearchComponent, useAsDefault: true), 
  const Route(path: '/create', name: 'Create', component: CreateComponent),   
  const Route(path: '/edit/:id', name: 'Edit', component: EditComponent) 
])

1 个答案:

答案 0 :(得分:3)

这样的东西
MyComponent {
  Router _router;
  MyComponent(this._router); 

  makeHttpRequest() {
    if(success) {
      _router.navigate(['/Edit', { id: entry['articleId'] }]) 
    }
  }
}

取决于您的具体用例

相关问题