How to use the ember-runtime/system/lazy_load.onLoad function in ember-runtime

To help you get started, we’ve selected a few ember-runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember.js / packages / ember-routing / lib / initializers / routing-service.js View on Github external
import { onLoad } from 'ember-runtime/system/lazy_load';
import RoutingService from 'ember-routing/services/routing';

onLoad('Ember.Application', function(Application) {
  Application.initializer({
    name: 'routing-service',
    initialize(registry) {
      // Register the routing service...
      registry.register('service:-routing', RoutingService);
      // Then inject the app router into it
      registry.injection('service:-routing', 'router', 'router:main');
    }
  });
});
github emberjs / ember.js / packages / ember-testing / lib / initializers.js View on Github external
import { onLoad } from "ember-runtime/system/lazy_load";

var name = 'deferReadiness in `testing` mode';

onLoad('Ember.Application', function(Application) {
  if (!Application.initializers[name]) {
    Application.initializer({
      name: name,

      initialize(registry, application) {
        if (application.testing) {
          application.deferReadiness();
        }
      }
    });
  }
});
github emberjs / ember.js / packages / ember-handlebars / lib / loader.js View on Github external
function registerComponentLookup(container) {
  container.register('component-lookup:main', ComponentLookup);
}

/*
  We tie this to application.load to ensure that we've at least
  attempted to bootstrap at the point that the application is loaded.

  We also tie this to document ready since we're guaranteed that all
  the inline templates are present at this point.

  There's no harm to running this twice, since we remove the templates
  from the DOM after processing.
*/

onLoad('Ember.Application', function(Application) {
  Application.initializer({
    name: 'domTemplates',
    initialize: _bootstrap
  });

  Application.initializer({
    name: 'registerComponentLookup',
    after: 'domTemplates',
    initialize: registerComponentLookup
  });
});

export default bootstrap;
github emberjs / ember.js / packages / ember-routing-views / lib / initializers / link-to-component.js View on Github external
import { onLoad } from "ember-runtime/system/lazy_load";
import linkToComponent from "ember-routing-views/views/link";

onLoad('Ember.Application', function(Application) {
  Application.initializer({
    name: 'link-to-component',
    initialize(registry) {
      registry.register('component:-link-to', linkToComponent);
    }
  });
});
github emberjs / ember.js / packages / ember-views / lib / initializers / components.js View on Github external
import { onLoad } from "ember-runtime/system/lazy_load";
import TextField from "ember-views/views/text_field";
import TextArea from "ember-views/views/text_area";
import Checkbox from "ember-views/views/checkbox";
import LegacyEachView from "ember-views/views/legacy_each_view";

onLoad('Ember.Application', function(Application) {
  Application.initializer({
    name: 'ember-views-components',
    initialize(registry) {
      registry.register('component:-text-field', TextField);
      registry.register('component:-text-area', TextArea);
      registry.register('component:-checkbox', Checkbox);
      registry.register('view:-legacy-each', LegacyEachView);
    }
  });
});