Accessing DOM node in initializers


#1

I create an instance of Framework7. While initializing, Framework7 did query some elements on DOM but not found.

Is there any way to init a global object(service…) that can access to DOM elements?

Many thanks.

export function initialize(container, application) {
  var f7 = new window.Framework7();

  application.register('f7:main', f7, { instantiate: false });
  application.inject('route', 'f7', 'f7:main');
  application.inject('controller', 'f7', 'f7:main');
  application.inject('component', 'f7', 'f7:main');
  application.inject('view', 'f7', 'f7:main');
}

export default {
  name: 'framework7-service',
  initialize: initialize
};