calculate Dynamicaly height of DOM in AngularJS -


i want measure height of dom element in angularjs when dom load complete.

myapp.directive('domheight',['$timeout',function($timeout){    return{      restrict:'ea',      scope:true,      link:function(scope,element,attrs){           $(document).ready(function(){              $('.required-wrapper').load(function(){                console.log( $('.required-wrapper').height());              })                        })      }    }  }])
**above code trigger height before dom load **

i try use $timeout this

not tested

    $('.required-wrapper').load(function(){       $timeout(function() {         //as far know there no event notify loaded dom has rendered         //so use timeout instead         console.log( $('.required-wrapper').height());       }, 100);       }) 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -