【发布时间】:2016-09-15 09:29:25
【问题描述】:
我正在使用 Angulars UI 路由器分别加载每个页面。我在 header.html 中有标题导航栏和侧边栏,在 login.html 中有主内容(动态)
登录 html 页面与侧边栏和页脚重叠,因为它是单独加载的。我该如何解决?我应用了 wrapper(custom css) 类,但它根本不影响布局。
这里是链接:http://angularspring-management999.rhcloud.com/default.html
示例代码:
<body>
<div id="wrap">
<!--header-->
<div ui-view="header"></div>
<!--sidebar-->
<div ui-view="sidebar"></div>
<!--main content-->
<div ui-view="content"></div>
</div>
<!--footer-->
<div ui-view="footer"></div>
</body>
州:
myApp.config(function ($stateProvider, $locationProvider, $urlRouterProvider, $httpProvider) {
// For any unmatched url, redirect to /login
$urlRouterProvider.otherwise("/Login");
var header = {
templateUrl: 'views/Header.html',
controller: function ($scope) {
}
};
var sidebar = {
templateUrl: 'views/SideBar.html',
controller: function ($scope) {
}
};
var footer = {
templateUrl: 'views/Footer.html',
controller: function ($scope) {
}
};
// Now set up the states
$stateProvider
.state('Login', {
url: "/Login",
views: {
'header': header,
'sidebar': sidebar,
content: {
templateUrl: 'views/Login.html',
controller: function ($scope) {
}
},
'footer': footer
}
});
【问题讨论】:
-
请在问题本身中包含相关代码。一旦该链接变坏,这个问题将毫无用处。见minimal reproducible example。
-
@MikeMcCaughan 代码很大。我会尽量精简并尽快更新它:)
标签: html css angularjs twitter-bootstrap-3