[英]How have in AngularJS with UI Router, multiple and nested views?
I have been reading about nested views and multiple views but I can't find an example using both 我一直在阅读有关嵌套视图和多个视图的信息,但找不到同时使用两者的示例
In a landing page I have multiple views, one after other. 在登录页面中,我有多个视图,一个接一个。 A picture speaks a thousand words:
图片说出一千个单词:
To consider: 要考虑:
/view1
, /view2
, /view3
, etc. /view1
, /view2
, /view3
等。 /view1/b
or /view3/b
and showing subview ( view1.b
or view3.b
). /view1/b
或/view3/b
并显示子视图( view1.b
或view3.b
) view3.b
。 I have success doing tasks separately but not all together. 我可以成功完成单独的任务,但不能一起完成任务。
you can use $statePorivder nested view with 您可以将$ statePorivder嵌套视图与
config(function ($stateProvider) {
$stateProvider
.state('main', {
url: '/',
views: {
'': {
templateUrl: 'app/main/layout.html',
controller: 'LayoutController'
},
'header@main': {
templateUrl: 'app/main/header/layout.html',
controller: require("./headerController.js")
},
'left@main': {
templateUrl: 'app/main/left/layout.html',
controller: require("./leftController.js")
},
'content@main': {
templateUrl: 'app/main/content/layout.html',
controller: require("./conentController.js")
},
'right@main': {
templateUrl: 'app/main/right/layout.html',
controller: require("./rightController.js")
}
}
});
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.