Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save astronomersiva/322b984826c06544707fea3c1c9e1b68 to your computer and use it in GitHub Desktop.
Save astronomersiva/322b984826c06544707fea3c1c9e1b68 to your computer and use it in GitHub Desktop.
nextSibiling issue
import Ember from 'ember';
const { on } = Ember;
export default Ember.Component.extend({
actions: {
toggle() {
console.log(this.$())
}
},
destroy: on('willDestroyElement', function () {
console.log(this.$())
// 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>
content within in if block
{{#my-component click=(action 'toggle')}}
<button> click me </button>
{{/my-component}}
<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": "3.2.2",
"ember-data": "2.11.0",
"ember-template-compiler": "3.2.2",
"ember-testing": "3.2.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment