Skip to content

Instantly share code, notes, and snippets.

@dandehavilland
Last active April 8, 2016 08:16
Show Gist options
  • Save dandehavilland/499dccb94945cbda7e8809384f4538b8 to your computer and use it in GitHub Desktop.
Save dandehavilland/499dccb94945cbda7e8809384f4538b8 to your computer and use it in GitHub Desktop.
RSVP _super bug
import Ember from 'ember';
import MixinOne from '../mixins/one';
import MixinTwo from '../mixins/two';
const {
on,
RSVP
} = Ember;
export default Ember.Controller.extend(MixinOne, MixinTwo, {
name: "RSVP _super bug",
theMethod() {
console.log('controller');
RSVP.resolve().then(() => {
// this._super === ROOT()
console.log(this._super);
this._super.apply(this, ['with promise']);
});
// this._super === superWrapper()
console.log(this._super);
this._super.apply(this, ['without promise']);
},
callTheMethod: on('init', function() {
this.theMethod();
})
});
import Ember from 'ember';
export default Ember.Mixin.create({
theMethod() {
console.log('mixin-one', arguments);
return this._super.apply(this, arguments);
}
});
import Ember from 'ember';
export default Ember.Mixin.create({
theMethod() {
console.log('mixin-two', arguments);
return this._super.apply(this, arguments);
}
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{
"version": "0.7.2",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.4.4/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment