How to use the ember-get-config.rootURL function in ember-get-config

To help you get started, we’ve selected a few ember-get-config 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 miguelcobain / ember-leaflet / addon / initializers / leaflet-assets.js View on Github external
export function initialize(/* container, application */) {
  if (typeof FastBoot === 'undefined' && typeof L !== 'undefined') {
    let prefix = '';

    if (!isNone(config.rootURL)) {
      prefix = config.rootURL;
    } else if (!isNone(config.baseURL)) {
      prefix = config.baseURL;
    }

    L.Icon.Default.imagePath = `${prefix}assets/images/`;
  }
}
github miguelcobain / ember-leaflet / app / initializers / leaflet-assets.js View on Github external
export function initialize(/* container, application */) {
  if (typeof FastBoot === 'undefined') {
    let prefix = '';

    if (!isNone(config.rootURL)) {
      prefix = config.rootURL;
    } else if (!isNone(config.baseURL)) {
      prefix = config.baseURL;
    }

    L.Icon.Default.imagePath = `${prefix}assets/images/`;
  }
}
github miguelcobain / ember-leaflet / app / initializers / leaflet-assets.js View on Github external
export function initialize(/* container, application */) {
  if (typeof FastBoot === 'undefined') {
    let prefix = '';

    if (!isNone(config.rootURL)) {
      prefix = config.rootURL;
    } else if (!isNone(config.baseURL)) {
      prefix = config.baseURL;
    }

    L.Icon.Default.imagePath = `${prefix}assets/images/`;
  }
}
github miguelcobain / ember-leaflet / addon / initializers / leaflet-assets.js View on Github external
export function initialize(/* container, application */) {
  if (typeof FastBoot === 'undefined' && typeof L !== 'undefined') {
    let prefix = '';

    if (!isNone(config.rootURL)) {
      prefix = config.rootURL;
    } else if (!isNone(config.baseURL)) {
      prefix = config.baseURL;
    }

    L.Icon.Default.imagePath = `${prefix}assets/images/`;
  }
}
github CenterForOpenScience / ember-osf-preprints / app / router.js View on Github external
import { inject as service } from '@ember/service';
import { run } from '@ember/runloop';
import EmberRouter from '@ember/routing/router';
import { getOwner } from '@ember/application';

import config from 'ember-get-config';

const Router = EmberRouter.extend({
    location: config.locationType,
    rootURL: config.rootURL,
    metrics: service(),
    theme: service(),
    session: service(),

    didTransition() {
        this._super(...arguments);
        this._trackPage();
    },

    _trackPage() {
        run.scheduleOnce('afterRender', this, () => {
            // Tracks page with custom parameters
            // authenticated => if the user is logged in or not
            // isPublic      => if the resource the user is viewing is public or private.
            //                  n/a is used for pages like discover and index
            // page          => the name of the current page
github ember-learn / ember-cli-addon-docs / addon / adapters / -addon-docs.js View on Github external
import DS from 'ember-data';
import config from 'ember-get-config';
import { inject as service } from '@ember/service';

export default DS.Adapter.extend({
  defaultSerializer: '-addon-docs',
  namespace: `${config.rootURL.replace(/\/$/, '')}/docs`,
  docsFetch: service(),

  shouldBackgroundReloadAll() {
    return false;
  },

  shouldBackgroundReloadRecord() {
    return false;
  },

  findRecord(store, modelClass, id, snapshot) {
    if (modelClass.modelName === 'project') {
      return this.get('docsFetch').fetch({ url: `${this.namespace}/${id}.json` }).json();
    } else {
      return store.peekRecord(modelClass.modelName, id);
    }
github CenterForOpenScience / ember-osf-web / app / router.ts View on Github external
registries,
    },
    featureFlagNames: {
        routes: routeFlags,
    },
} = config;

const Router = EmberRouter.extend({
    currentUser: service('current-user'),
    features: service('features'),
    statusMessages: service('status-messages'),
    ready: service('ready'),

    readyBlocker: null as Blocker | null,
    location: config.locationType,
    rootURL: config.rootURL,
    shouldScrollTop: true,

    willTransition(oldInfo: any, newInfo: any, transition: { targetName: string }) {
        if (!this.readyBlocker || this.readyBlocker.isDone()) {
            this.readyBlocker = this.get('ready').getBlocker();
        }

        this._super(oldInfo, newInfo, transition);
    },

    didTransition(...args: any[]) {
        this._super(...args);

        this.get('currentUser').checkShowTosConsentBanner();
        this.get('statusMessages').updateMessages();