Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

on document ready #72

Closed
telekosmos opened this issue Apr 14, 2015 · 2 comments
Closed

on document ready #72

telekosmos opened this issue Apr 14, 2015 · 2 comments
Labels

Comments

@telekosmos
Copy link

Hi
So, the question is just that, is there any event triggered on document ready? Kind of similar to angular angular.element(document).ready(...) or $document.ready(...). I've checked AureliaStarted event from the repo, but I guess it is triggered just when the Aurelia resources (not the application resources) are loaded.

Cheers!

@telekosmos
Copy link
Author

Ok I got it (or at least I got one way):

import  $ from 'jquery';

export function configure(aurelia) {
  aurelia.use
    .standardConfiguration()
    .developmentLogging();

  aurelia.start()
    .then(a => a.setRoot('app', document.body))
    .then(a => {
      // here the DOM is ready
      $(document).ready(() => {
      // some initialization
      });
    });
}

More info @ Startup and config and the code

@EisenbergEffect
Copy link
Contributor

There's no need to every use the jQuery document ready. Once the configure method is called, the document is already ready. If you need to know, on a per component basis, when it's attached to the DOM, you can use the attached callback.

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

No branches or pull requests

2 participants