Skip to content

Instantly share code, notes, and snippets.

@teddyzeenny
Created August 28, 2016 13:24
Show Gist options
  • Save teddyzeenny/08d6a23620768a48f018e86384f5e0ff to your computer and use it in GitHub Desktop.
Save teddyzeenny/08d6a23620768a48f018e86384f5e0ff to your computer and use it in GitHub Desktop.
"willRender" doesn't fire when you expect it to
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
show: true,
actions: {
toggle() {
this.toggleProperty('show');
}
}
});
Ember.subscribe("render", {
before(name, timestamp, payload) {
console.log('INSTRUMENTATION TRIGGERED');
}
});
<h3>"willRender" doesn't fire when you expect it to</h3>
<p>Toggle the component. Instrumentation is triggered when the component is added but not when it's removed (check the console). Instrumentation code is in the application controller module.</p>
<button {{action "toggle"}}>Toggle Component</button>
{{#if show}}
{{my-component}}
{{/if}}
<br>
<br>
{
"version": "0.10.4",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "alpha",
"ember-data": "2.7.0",
"ember-template-compiler": "alpha"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment