Skip to content

Commit

Permalink
Merge pull request #18283 from mukilane/ember-array-invoke-doc
Browse files Browse the repository at this point in the history
[DOC] Add examples for EmberArray#invoke
  • Loading branch information
locks authored Aug 20, 2019
2 parents 205635c + 9120a19 commit 75c707d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/@ember/-internals/runtime/lib/mixins/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,18 @@ const ArrayMixin = Mixin.create(Enumerable, {
implements it. This method corresponds to the implementation in
Prototype 1.6.
```javascript
const Person = EmberObject.extend({
name: null,
greet(prefix) {
return `${prefix} ${this.name}`;
}
});
let people = [Person.create('Joe'), Person.create('Matt')];
people.invoke('greet', 'Hello'); // ['Hello Joe', 'Hello Matt']
```
@method invoke
@param {String} methodName the name of the method
@param {Object...} args optional arguments to pass as well.
Expand Down

0 comments on commit 75c707d

Please sign in to comment.