角度2+とUIルーターには少し問題があります。角2 UIルーター表示が表示されない
私のアプリには1(全システムで1つ)のui-viewがあります。私はすべてのルート状態を宣言するとき、すべての大丈夫と魔法ですが、私は子の状態を宣言するとき、コンポーネントを読み込まれません。 URLは変更されますが、コンポーネントは表示されません。
私のコードは次のとおりです。 App.component.html:
<div>
<ui-view></ui-view>
</div>
国家宣言:
export const Ruteo: Ng2StateDeclaration[] = [
{ name: 'repartidores', url: '/Repartidores', component: RepartidoresComponent },
{ name: 'repartidores.alta', url: '/Nuevo', component: RepartidoresAltaComponent },
{ name: 'repartidores.modi', url: '/Modificar/{i}', component: RepartidoresModiComponent },
{ name: 'ayuda', url: '/Ayuda', component: AyudaComponent }
];
App.module.ts
imports: [
BrowserModule,
UIRouterModule.forRoot({ states: Ruteo, useHash: true, config: Configurar }),
HttpModule,
FormsModule
],
私はすべてのルートが表示さよりも欲しいですappコンポーネント内のコンポーネントui-view。
申し訳ありませんが、私の英語は非常に悪いです...
はあなたに感謝します。
私は** **と** {名などのすべての宣言しようとした: 'repartidores' を、 URL: '/ Repartidores'、ビュー:{ルート:{コンポーネント:RepartidoresComponent}}} **動作しません –
チェックhttp://github.com/angular-ui/ui-router/issues/3223 –
私は、しかし、私は子供が親の同じUIビューを使用するが、angularjのようには動作しない必要があります。 –