Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Problem with $viewContentLoaded #1657

Closed
vslinko opened this issue Dec 5, 2012 · 2 comments
Closed

Problem with $viewContentLoaded #1657

vslinko opened this issue Dec 5, 2012 · 2 comments

Comments

@vslinko
Copy link

vslinko commented Dec 5, 2012

Hello.

Sometimes I need make ajax request with fully rendered html right after rendering.

I found comment #734 (comment) with necessary event, but $viewContentLoaded doesn't work as I expect.

  $scope.$on('$viewContentLoaded', function () {
      checkPageIsRendered();

      setTimeout(function () {
          checkPageIsRendered();
          document.write(statuses.join(' '));
      }, 100);
  });

That code prints false truehttp://embed.plnkr.co/BZl11W

If it is not bug but feature please tell me how to subscribe to right event?

@pkozlowski-opensource
Copy link
Member

@vslinko as you can see from the discussion in the #734 figuring out the moment "right after rendering" is a tricky business with AngularJS and frankly the underlying philosophy is different - we should be rather reacting on the model changes instead of sniffing DOM rendering.

It would be easier to help if you could elaborate more on what you are trying to achieve, functionally speaking.
Anyway, it sounds more like a general question about AngularJS usage and architecture and not a bug report / feature request. As such would be better asked on the mailing list (https://groups.google.com/group/angular), StackOverflow or the IRC (#angularjs) channel. The mailing list is very active and people there will be happy to help.

I'm going to close this ticket now as we would like to keep GitHub issues for bug reports and future requests only. Please feel free to reopen it if you still believe that there is a bug in AngularJS.

@wangchuanyin
Copy link

hi vslinko,
Sometimes I need make ajax request with fully rendered html right after rendering, as you mentioned issue, currently how to resolve it ? thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants