search

Home  >  Q&A  >  body text

angular.js - angularJS: Execute js after data is loaded

Use

<p id="goodlist">
   <p ng-repeat="good in goods">{{good}}</p>
</p>

After the data cycle is completed, I use js to obtain the height of p, but the obtained value is always wrong. How to solve it?

巴扎黑巴扎黑2830 days ago528

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-15 17:03:01

    Put the code for getting p height inside $timeout() and try it

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-15 17:03:01

    http://stackoverflow.com/questions/13471129/ng-repeat-finish-event

    reply
    0
  • Cancelreply