Tôi có một cấu hình như dưới đây:Bộ định tuyến giao diện người dùng AngularJS: Cách định cấu hình chế độ xem được đặt tên lồng nhau?
...
.state('profiles', {
abstract: true
, url : '/profiles'
, resolve: {...}
, views: {
mainModule: {
templateUrl : '/partials/home.html'
, controller : 'HomeCtrl'
}
, leftSidePaneModule: {
templateUrl : '/partials/leftSidePane.html'
, controller : 'LeftSidePaneCtrl'
}
}
})
...
chính Jade tập
...
.col-xs-4.col-md-4.chat_block(ui-view='leftSidePaneModule', autoscroll="false")
...
Vì vậy, leftSidePaneModule
mô-đun được dân cư trong để ui-view='leftSidePaneModule'
giữ chỗ. Nhưng vấn đề là, tôi có thêm 2 lượt xem có tên trong mẫu leftSidePaneModule
. leftSidePaneModule
mẫu trông như thế này:
leftSidePaneModule.html
<div>
<div ui-view="leftWidgetOne"></div>
<div ui-view="leftWidgetTwo"></div>
</div>
Làm thế nào để tôi làm cho module leftWidgetOne
& leftWidgetOne
được dân cư trong để giữ chỗ trên?
tôi đã cố gắng,
...
.state('profiles', {
abstract: true
, url : '/profiles'
, resolve: {...}
, views: {
mainModule: {
templateUrl : '/partials/home.html'
, controller : 'HomeCtrl'
}
, leftSidePaneModule: {
templateUrl : '/partials/leftSidePane.html'
, controller : 'LeftSidePaneCtrl'
}
, '[email protected]dePaneModule' : {...}
, '[email protected]' : {...}
}
})
...
Attempt: 2
...
.state('profiles', {
abstract: true
, url : '/profiles'
, resolve: {...}
, views: {
mainModule: {
templateUrl : '/partials/home.html'
, controller : 'HomeCtrl'
}
, leftSidePaneModule: {
templateUrl : '/partials/leftSidePane.html'
, controller : 'LeftSidePaneCtrl'
, views: {
'leftWidgetOne' : {...}
, 'leftWidgetTwo' : {...}
}
}
}
})
...
Cả hai đều không làm việc.
Bạn làm như thế nào?
Cảm ơn!
Điều này có thể giúp bạn: http://stackoverflow.com/questions/12863663/angularjs-complex-nesting-of-partials-and-templates – Iansen
đây là * không * lồng nhau v iews ... chúng song song ... – user3338098