Skip to content

Instantly share code, notes, and snippets.

@kybishop
Last active September 1, 2017 18:05
Show Gist options
  • Save kybishop/cea8fd6693c7fe4870e3243deafbfed0 to your computer and use it in GitHub Desktop.
Save kybishop/cea8fd6693c7fe4870e3243deafbfed0 to your computer and use it in GitHub Desktop.
Bug
import Ember from 'ember';
export default Ember.Component.extend({
inElementContainer: Ember.computed(function() {
return document.querySelector('.ember-application');
}),
didInsertElement() {
this._super(...arguments);
Ember.run.next(() => {
this.element.parentNode.setAttribute('aria-describedby', this.get('id'));
});
},
willDestroyElement() {
this._super(...arguments);
this.element.parentNode.removeAttribute('aria-describedby');
},
});
import Ember from 'ember';
export default Ember.Controller.extend({
show: true,
actions: {
toggleShow() {
this.toggleProperty('show');
}
}
});
<button {{action 'toggleShow'}}>{{if show 'hide' 'show'}}</button>
<br><br>
<span>&nbsp;</span>
<div id="parent">
{{#if show}}
{{my-component id='some-id'}}
{{/if}}
</div>
{{#-in-element inElementContainer}}
Hello!
{{/-in-element}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "beta",
"ember-template-compiler": "beta",
"ember-testing": "beta"
},
"addons": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment