API Docs for: 1.0 pre
Show:

Ember.SubArray Class

An Ember.SubArray tracks an array in a way similar to, but more specialized than, Ember.TrackedArray. It is useful for keeping track of the indexes of items within a filtered array.

Item Index

Methods

addItem

(
  • index
  • match
)
Number

Track that an item was added to the tracked array.

Parameters:

  • index Number

    The index of the item in the tracked array.

  • match Boolean

    true iff the item is included in the subarray.

Returns:

Number:

The index of the item in the subarray.

removeItem

(
  • index
)
Number

Track that an item was removed from the tracked array.

Parameters:

  • index Number

    The index of the item in the tracked array.

Returns:

Number:

The index of the item in the subarray, or -1 if the item was not in the subarray.