Skip to content

Instantly share code, notes, and snippets.

@foxnewsnetwork
Last active March 20, 2018 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxnewsnetwork/c68601a64d6919574ff798155595516e to your computer and use it in GitHub Desktop.
Save foxnewsnetwork/c68601a64d6919574ff798155595516e to your computer and use it in GitHub Desktop.
Component double render
import Ember from 'ember';
export default Ember.Component.extend({
willInsertElement() {
Ember.tryInvoke(this, 'action');
}
}).reopenClass({
positionalParams: ['action']
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
}
});
<h1>Welcome to {{appName}}</h1>
<p>
Open your console log and check out the double render error on "appName"
</p>
<p>
On the other hand, if you move the h1 element from the top to below the did-load, the double-render goes away!
</p>
<br>
<br>
{{did-load (action (mut appName) 'render-1')}}
<p>This won't render</p>
{{outlet}}
<br>
<br>
{
"version": "0.13.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.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment