Created
June 26, 2018 20:22
-
-
Save runspired/5421efea97990827d9422b41182431ca to your computer and use it in GitHub Desktop.
ArrayProxy Issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
const { ArrayProxy, set } = Ember; | |
const CustomArrayProxy = ArrayProxy.extend({ | |
willDestroy() { | |
set(this, 'content.length', 0); | |
set(this, 'content', []); | |
set(this, 'length', 0); | |
this._super(...arguments); | |
} | |
}); | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
init() { | |
this._super(); | |
this.proxyArray = CustomArrayProxy.create({ | |
content: [ | |
{ name: 'hello' } | |
] | |
}); | |
}, | |
actions: { | |
bam() { | |
this.proxyArray.destroy() | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.14.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "2.18.2", | |
"ember-template-compiler": "2.18.2", | |
"ember-testing": "2.18.2" | |
}, | |
"addons": { | |
"ember-data": "2.18.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment