title: Angularjs ng-repeat: how to target an element
body: <p>I have a list of div elements, when the customer selected an element, the detail view appear.
  After the back, i want to target my list on selected element.</p>
  
  <pre><code>&lt;div id="patient{{patient.PId}}" class="div-patient" ng-repeat="patient in patients"&gt;
     &lt;p&gt;{{patient.name}}&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have tested many code to scroll on a selected patient:</p>
  
  <pre><code>$(window).scrollTop($("#patient"+$rootScope.selectedPatient).offset().top);
  // or
  $("html, body").animate({ scrollTop:angular.element("#patient"+$rootScope.selectedPatient).prop( 'offsetTop' ) });
  //or
  $(window).scrollTop(angular.element("#patient"+$rootScope.selectedPatient).prop( 'offsetTop' ));
  </code></pre>
  
  <p>The css div-patient:</p>
  
  <pre><code>position: absolute;
  height: 330px;
  margin-bottom: 30px;
  top: {{360*fixTopCell($index)}}px;
  </code></pre>
  
  <p>But </p>
  
  <pre><code>$("#patient"+$rootScope.selectedPatient).offset().top
  </code></pre>
  
  <p>and</p>
  
  <pre><code>angular.element("#patient"+$rootScope.selectedPatient).prop( 'offsetTop' )
  </code></pre>
  
  <p>Return 0 all the time.</p>
  
  <p>It works when I use a <i>table</i> tag instead of a <i>div</i>.</p>
  
  <p>I see that the function scrollTop is not available in Android 4.X.
  Are there others solutions to target the element selected after a back on list?</p>