Skip to content

Instantly share code, notes, and snippets.

@k-fish
Created May 2, 2019 17:05
Show Gist options
  • Save k-fish/0e2583da40569cd5aaf39ce831e164fa to your computer and use it in GitHub Desktop.
Save k-fish/0e2583da40569cd5aaf39ce831e164fa to your computer and use it in GitHub Desktop.
Check invoke return
import Ember from 'ember';
class TestClass {
someFunction() {
return 'abc';
}
}
export default Ember.Controller.extend({
init() {
const list = [new TestClass(), new TestClass(), new TestClass()];
const result = list.invoke('someFunction');
this.set('result', result);
}
});
<h1>Check invoke return</h1>
<br>
<br>
{{outlet}}
<br>
<br>
Result: {{result}}
{
"version": "0.15.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": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment