javascript - How to set style in angularjs depending on a different element height after page load? -


i have header element has dynamic height initialized once. want set element, foo, in scrollable view of angular app has height of screen, minus header height. fit onto screen. below element has height 100vh - dynamic size, more elements.

i read 1 can use this:

var myheight = angular.element(document.queryselector('#header'))[0].offsetheight

and use in dynamic inline styling e.g.

<foo style="height: calc(100vh - {{myheight}})">

note: calc css function.

but use it? when app loaded correct height?

try this

$scope.$on('$viewcontentloaded', function(){    //here view content loaded !! }); 

there more ways more info can check this


Comments

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

r - Quantstrat logical error while running applySignals - missing value where TRUE/FALSE needed -