I am running two ember applications. One has the following component:
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'a', click: function() { Ember.$('#wrapper').toggleClass('toggled'); } });
and the other has the following:
import Ember from 'ember'; export default Ember.Component.extend({ tagName: 'a', click: function() { this.$('#wrapper').toggleClass('toggled'); } });
I canβt understand why in one application I select an element by identifier using Ember.$('#wrapper') , and in another this.$('#wrapper') .
What is it? Amber version?
UPDATE
I am very puzzled since both components are the same:
{{#show-menu}} <i class="fa fa-bars"></i>` {{/show-menu}}`
They are a hamburger menu that hides the sidebar of a div, and #wrapper is an external element.
Since in both cases #wrapper are external elements, should not only the first case of @Gaurav and @Kevin Jhangiani work?
source share