Skip to content

Instantly share code, notes, and snippets.

@siva-sundar
Last active August 8, 2018 06:52
Show Gist options
  • Save siva-sundar/acdfe339f376a7ff6798f3e3e920f164 to your computer and use it in GitHub Desktop.
Save siva-sundar/acdfe339f376a7ff6798f3e3e920f164 to your computer and use it in GitHub Desktop.
nextSibiling issue
import Ember from 'ember';
const { on } = Ember;
export default Ember.Component.extend({
destroy: on('willDestroyElement', function () {
this.$().remove();
})
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
myName: 'siva',
fun: true,
canShow: true,
actions: {
toggle() {
this.toggleProperty('canShow');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
<p style="color: red;">
Notice that the Static Element will be removed since we are removing the component manually.
</p>
<hr>
{{#if canShow}}
content within in if block
{{#my-component click=(action 'toggle')}}
<button> click me </button>
{{/my-component}}
{{/if}}
<div style="padding-top: 10px">
static content outside if block
</div>
{{outlet}}
<br>
<br>
{
"version": "0.11.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment