Skip to content

Instantly share code, notes, and snippets.

@rwjblue
Created February 24, 2017 14:27
Show Gist options
  • Save rwjblue/69cac8191ea8f98869513c76262dd99b to your computer and use it in GitHub Desktop.
Save rwjblue/69cac8191ea8f98869513c76262dd99b to your computer and use it in GitHub Desktop.
with extend_prototypes false
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
errors: null,
init() {
this._super(...arguments);
let errors = Ember.A();
errors.pushObject({
'code': 140,
'message': 'Hello World'
});
this.set('errors', errors)
},
actions: {
clearErrors() {
this.get('errors').clear();
},
consoleLogClear(){
console.log(this.get('errors').clear);
}
}
});
{{errors.firstObject.message}}
<button {{action "clearErrors"}}>Clear errors</button>
<button {{action "consoleLogClear"}}>Output the .clear function to console</button>
{
"version": "0.11.0",
"EmberENV": {
"EXTEND_PROTOTYPES": false,
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "release",
"ember-data": "2.11.0",
"ember-template-compiler": "release",
"ember-testing": "release",
"prototype": "https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment