title: Angular directive - offsetHeight outputs 0
body: <p>I have a simple popup directive, in there i need to find the height of a div. </p>
  
  <p>When I output the div <code>console.log($elem.find('.reviews-slide-detail'))</code>, it shows me the full object, with <code>[0] -&gt; offsetHeight</code> showing a number (223).</p>
  
  <p>But when I try to output the number directly <code>console.log($elem.find('.reviews-slide-detail')[0].offsetHeight);</code>, it shows 0.</p>
  
  <p>My div is not hidden, its fix positioned and very normal in styling. </p>
  
  <p>Does anyone know any reason to this difference?</p>
  
  <p>EDIT:</p>
  
  <p>Part of the directive:</p>
  
  <pre><code>function resultReviewDirective($timeout, $http, $state, UtilService, ResultService, Session, $window) {
      return {
          restrict: 'AEC',
          replace: true,
          templateUrl: 'modules/core/templates/result.review.html',           
          link: function($scope, $elem, $attrs){
  
  
              $scope.reviewFunc.setHeight = function() {
  
  
                  console.log($elem.find('.reviews-slide-detail'));
                  console.log($elem.find('.reviews-slide-detail')[0].offsetHeight);
  
  
              };
  
          }
      };
  }
  
  
  angular.module('core').directive('resultReview', resultReviewDirective);
  </code></pre>