Currently, I am working on developing an AngularJS app and my index page consists of a ng-view where all the content is injected using ui-router:
<header>
<nav class="navbar">
//content for navbar will go here
</nav
</header>
<div ng-view></div>
The issue I am facing is that the home page needs to have 100% height. Since it is injected in ng-view, I am setting ng-view’s height to 100%. This results in vertical overflow on other pages rendered within the ng-view - the total height of ng-view (100%) plus the menu’s height that lies outside of ng-view.
You can check out an example on Plunker here.
Does anyone have any suggestions on how I can resolve this issue?
Although I accepted an answer previously, I was still experiencing problems because the home page required 100% height. Using CSS calc would cut off the specified percentage and setting overflow-y to hidden prevented me from scrolling down. In the end, I resolved the issue by using Viewport Percentage - setting the ng-view div to 100vh in my CSS solved the problem for me.
height: 100vh;