ember-cli-array-offset

1.0.0 • Public • Published

ember-cli-array-offset

master branch build status

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

License

MIT license.

Readme

Keywords

Package Sidebar

Install

npm i ember-cli-array-offset

Weekly Downloads

6

Version

1.0.0

License

MIT

Last publish

Collaborators

  • j-