4

How can I know when ng-view is completely rendered. Currently I have tried to use

$scope.$on('$viewContentLoaded', function() { }
$scope.$on('$routeChangeSuccess', function() { }
angular.element(document).ready(function() { }

but all these are firing before view is rendered.

Nicholas Murray
  • 13,305
  • 14
  • 65
  • 84
Tino
  • 220
  • 6
  • 17
  • Did you try using the `onload` argument of the [ng-view directive](http://code.angularjs.org/1.2.14/docs/api/ngRoute/directive/ngView)? – JoseM Mar 19 '14 at 15:50

1 Answers1

3

As I mentioned in the comment, use the onload argument of the ng-view directive

JoseM
  • 4,302
  • 2
  • 24
  • 35
  • I'm using `onload` and first time it works fine. but second time, when `onload` is triggered, content is not updated yet. Actually I'm trying to wrap loaded content into some structure, and first time it works but next times it doesn't! – Alireza Mirian Oct 21 '14 at 01:04