Angular 2 ES5のチート シートには、次のように書かれています。
var MyComponent = ng.router.RouteConfig([
{ path: '/:myParam', component: MyComponent, as: 'MyCmp' },
{ path: '/staticPath', component: ..., as: ...},
{ path: '/*wildCardParam', component: ..., as: ...}
]).Class({
constructor: function() {}
});
@Component
ただし、実際にインスタンス化できるように、そのクラスのものを指定する方法がわかりません。例えば、
ng.router.RouteConfig([...]).Component({})
の結果にメソッド.RouteConfig
がないため、例外がスローされます。.Component
同様に、の結果にはメソッド.Component
がありません.RouteConfig
。これをどのようにセットアップしますか?