Angular2 的新路由器组件似乎没有提供 templateUrl 。

The new Router Component for Angular2 does not seem to have provision for templateUrl .

Angular2 的新路由器组件似乎没有提供 templateUrl 。有没有一种方法可以在提供 templateUrl 的同时使用 $stateProviders 导航到页面? 似乎也没有对决心的支持。在调用 controller/component 之前从 rest 调用获取数据的最佳方法是什么?

路由器不支持templateUrl

您可以使用 return 未来
的守卫(CanActivate 另见 https://angular.io/docs/ts/latest/guide/router.html) 或者用 *ngIf="data"

包裹你的模板