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()); }) }) } } }])
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
Post a Comment