1.0.0 • Published 8 years ago
ember-cli-array-offset v1.0.0
ember-cli-array-offset
Ember CLI array offset addon.
ember-cli-array-offset
exposes an Ember ArrayProxy subclass
which returns only the content array items after a certain offset.
Example
import Ember from 'ember';
import ArrayOffset from 'array-offset';
var arr = Ember.A(['a', 'b', 'c', 'd', 'e', 'f']);
var proxy = ArrayOffset.create({
content: arr,
offset: 3
});
console.log(proxy.toArray()); // ['d', 'e', 'f']
proxy.incrementProperty('offset');
console.log(proxy.toArray()); // ['e', 'f']
arr.pushObject('g');
console.log(proxy.toArray()); // ['e', 'f', 'g']
Properties
content
: Ember.Array (optional, default = null
)
The content array. Must be an object that implements Ember.Array
and/or
Ember.MutableArray
. See Ember.ArrayProxy#content
.
offset
: Number (optional, default = 0
)
This value determines the index of the first element to return.
Installing
With npm:
$ npm install --save-dev ember-cli-array-offset
Or with Ember CLI:
$ ember install ember-cli-array-offset