【发布时间】:2015-04-12 17:59:57
【问题描述】:
这是我的例子
http://plnkr.co/edit/Foc5vEa5HJ0Uz1fGZXtS?p=preview
css:
.header{
background:#f00;
height: 40px;
position: fixed;
width: 100%;
}
html,body{
height:100%;
margin:0;
}
.footer{
background:#00f;
height:40px;
}
.main{
padding-top:40px;
min-height:calc(100% - 80px);
}
.main-section{
height:100%;
background:#fF0;
}
.fit-parent-height{
height:100%;
}
html:
<body ng-controller="MainCtrl">
<div class="header">HEADER</div>
<div class="main" fit-parent-height>
<div class="main-section" ng-include="'main-section.html'" ></div>
<div class="footer">FOOTER</div>
</div>
</body>
js:
scope.$on('$viewContentLoaded',function(e){
//add class to change min-height to height in css;
})
我想让 main-section 块高度适合父级 但它不起作用....
我尝试绑定$viewContentLoaded、$stateChangeSuccess、$includeContentLoaded,但还是不行。
请帮帮我,谢谢。
【问题讨论】:
标签: javascript jquery angularjs events angularjs-ng-include