Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 1.96 KB

File metadata and controls

90 lines (70 loc) · 1.96 KB

ember-jquery

Usage

npx ember-component-jquery ember-jquery path/of/files/ or/some**/*glob.js

# or

yarn global add ember-component-jquery
ember-component-jquery ember-jquery path/of/files/ or/some**/*glob.js

Input / Output


with-import

Input (with-import.input.js):

import $ from 'jquery';
import Component from '@ember/component';

export default Component.extend({
  didInsertElement() {
    Em.$('.test').focus();
    Em.$(this.element).focus();
    Ember.$('.test').focus();
    Ember.$(this.element).focus();
  },
});

Output (with-import.output.js):

import $ from 'jquery';
import Component from '@ember/component';

export default Component.extend({
  didInsertElement() {
    $('.test').focus();
    $(this.element).focus();
    $('.test').focus();
    $(this.element).focus();
  },
});

without-import

Input (without-import.input.js):

import Component from '@ember/component';

export default Component.extend({
  didInsertElement() {
    Em.$('.test').focus();
    Em.$(this.element).focus();
    Ember.$('.test').focus();
    Ember.$(this.element).focus();
  },
});

Output (without-import.output.js):

import $ from 'jquery';
import Component from '@ember/component';

export default Component.extend({
  didInsertElement() {
    $('.test').focus();
    $(this.element).focus();
    $('.test').focus();
    $(this.element).focus();
  },
});