Array#lastIndexOf()

lastIndexOf (object, startAt) Numberpublic Defined in packages/ember-runtime/lib/mixins/array.js:413 Returns the index of the given object's last occurrence. If no startAt argument is given, the search starts from the last position. If it's negative, will count backward from the end of the array. Returns -1 if no match is found. let arr = ['a', 'b', 'c', 'd', 'a']; arr.lastIndexOf('a'); // 4 arr.lastIndexOf('z'); // -1 arr.lastIndexOf('a', 2); // 0 arr.lastIndexOf('a', -1)

Array#indexOf()

indexOf (object, startAt) Numberpublic Defined in packages/ember-runtime/lib/mixins/array.js:370 Returns the index of the given object's first occurrence. If no startAt argument is given, the starting location to search is 0. If it's negative, will count backward from the end of the array. Returns -1 if no match is found. let arr = ['a', 'b', 'c', 'd', 'a']; arr.indexOf('a'); // 0 arr.indexOf('z'); // -1 arr.indexOf('a', 2); // 4 arr.indexOf('a', -1); // 4 arr.indexOf('

Array#includes()

includes (obj, startAt) Booleanpublic Inherited from Ember.Enumerable but overwritten in packages/ember-runtime/lib/mixins/array.js:593 Returns true if the passed object can be found in the array. This method is a Polyfill for ES 2016 Array.includes. If no startAt argument is given, the starting location to search is 0. If it's negative, searches from the index of this.length + startAt by asc. [1, 2, 3].includes(2); // true [1, 2, 3].includes(4); // false [1, 2, 3].includes(3, 2);

Array#hasArrayObservers

hasArrayObserversBooleanpublic Defined in packages/ember-runtime/lib/mixins/array.js:506 Becomes true whenever the array currently has observers watching changes on the array.

Array#arrayContentWillChange()

arrayContentWillChange (startIdx, removeAmt, addAmt) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/array.js:517 If you are implementing an object that supports Ember.Array, call this method just before the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change. Parameters: startIdx Number The starting index in the array that will change. removeAmt Number

Array#arrayContentDidChange()

arrayContentDidChange (startIdx, removeAmt, addAmt) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/array.js:536 If you are implementing an object that supports Ember.Array, call this method just after the array content changes to notify any observers and invalidate any related properties. Pass the starting index of the change as well as a delta of the amounts to change. Parameters: startIdx Number The starting index in the array that did change. removeAmt Number The

Array#addArrayObserver()

addArrayObserver (target, opts) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/array.js:460 Adds an array observer to the receiving array. The array observer object normally must implement two methods: arrayWillChange(observedObj, start, removeCount, addCount) - This method will be called just before the array is modified. arrayDidChange(observedObj, start, removeCount, addCount) - This method will be called just after the array is modified. Both callbacks will be passed t

Array#@each

@eachpublic Defined in packages/ember-runtime/lib/mixins/array.js:555 Returns a special object that can be used to observe individual properties on the array. Just get an equivalent property on this object and it will return an enumerable that maps automatically to the named key on the member objects. @each should only be used in a non-terminal context. Example: myMethod: computed('posts.@each.author', function(){ ... }); If you merely want to watch for the array being changed, like an o

Array

Ember.Array Class PUBLIC Uses: Ember.Enumerable Defined in: packages/ember-runtime/lib/mixins/array.js:173 Module: ember-runtime This mixin implements Observer-friendly Array-like behavior. It is not a concrete implementation, but it can be used up by other classes that want to appear like arrays. For example, ArrayProxy is a concrete classes that can be instantiated to implement array-like behavior. Both of these classes use the Array Mixin by way of the MutableArray mixin, which allows o

AriaRoleSupport#sendAction()

sendAction (action, params) public Defined in packages/ember-views/lib/mixins/action_support.js:23 Calls an action passed to a component. For example a component for playing or pausing music may translate click events into action notifications of "play" or "stop" depending on some internal state of the component: // app/components/play-button.js export default Ember.Component.extend({ click() { if (this.get('isPlaying')) { this.sendAction('play'); } else { this.sendAct