How to use ember-wormhole - 4 common examples

To help you get started, we’ve selected a few ember-wormhole 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 yapplabs / ember-wormhole / tests / dummy / app / components / x-favicon.js View on Github external
import { computed } from '@ember/object';
import Wormhole from 'ember-wormhole/components/ember-wormhole';
import layout from '../templates/components/x-favicon';

export default Wormhole.extend({
  layout,
  destinationElement: computed(function () {
    return document.getElementsByTagName('head')[0];
  })
});
github yapplabs / ember-wormhole / tests / dummy / app / components / document-title.js View on Github external
import { computed } from '@ember/object';
import { A } from '@ember/array';
import Wormhole from 'ember-wormhole/components/ember-wormhole';

var titles = A([]);
export default Wormhole.extend({
  init: function () {
    this._super();

    if (titles.length === 0) {
      document.title = '';
    }
    titles.push(this);
  },

  destinationElement: computed(function () {
    return document.getElementsByTagName('title')[0];
  }),

  willDestroyElement: function () {
    titles.removeObject(this);
    this._super.apply(this, arguments);
github yapplabs / ember-wormhole / tests / dummy / app / components / ember-wormhole.js View on Github external
import { on } from '@ember/object/evented';
import EmberWormhole from 'ember-wormhole/components/ember-wormhole';

export default EmberWormhole.extend({
  _storeSelf: on('didInsertElement', function () {
    this.$().data('ember-wormhole', this);
  }),

  _removeSelf: on('willDestroyElement', function () {
    this.$().removeData();
  })
});
github cibernox / ember-basic-dropdown / addon / components / basic-dropdown / wormhole.js View on Github external
import WormholeComponent from 'ember-wormhole/components/ember-wormhole';

export default WormholeComponent.extend({
  didInsertElement() {
    this._super(...arguments);
    let didInsert = this.getAttr('didInsert');
    if (didInsert) {
      didInsert();
    }
  },

  willDestroyElement() {
    this._super(...arguments);
    let willRemove = this.getAttr('willRemove');
    if (willRemove) {
      willRemove();
    }
  }
});

ember-wormhole

Render a child view somewhere else in the DOM.

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis

Popular ember-wormhole functions