MutableArray#removeAt()

removeAt (start, len) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/mutable_array.js:139 Remove an object at the specified index using the replace() primitive method. You can pass either a single index, or a start and a length. If you pass a start and length that is beyond the length this method will throw an OUT_OF_RANGE_EXCEPTION. let colors = ['red', 'green', 'blue', 'yellow', 'orange']; colors.removeAt(0); // ['green', 'blue', 'yellow', 'orange'] colors.removeAt(2,

MutableArray#pushObjects()

pushObjects (objects) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/mutable_array.js:185 Add the objects in the passed numerable to the end of the array. Defers notifying observers of the change until all objects are added. let colors = ['red']; colors.pushObjects(['yellow', 'orange']); // ['red', 'yellow', 'orange'] Parameters: objects Ember.Enumerable the objects to add Returns: Ember.Array receiver

MutableArray#insertAt()

insertAt (idx, object) Ember.Arraypublic Defined in packages/ember-runtime/lib/mixins/mutable_array.js:113 This will use the primitive replace() method to insert an object at the specified index. let colors = ['red', 'green', 'blue']; colors.insertAt(2, 'yellow'); // ['red', 'green', 'yellow', 'blue'] colors.insertAt(5, 'orange'); // Error: Index out of range Parameters: idx Number index of insert the object at. object Object object to insert Returns: Ember.Array receiver

MutableArray#popObject()

popObjectpublic Defined in packages/ember-runtime/lib/mixins/mutable_array.js:208 Pop object from array or nil if none are left. Works just like pop() but it is KVO-compliant. let colors = ['red', 'green', 'blue']; colors.popObject(); // 'blue' console.log(colors); // ['red', 'green'] Returns: object

MutableArray#pushObject()

pushObject (obj) public Defined in packages/ember-runtime/lib/mixins/mutable_array.js:164 Push the object onto the end of the array. Works just like push() but it is KVO-compliant. let colors = ['red', 'green']; colors.pushObject('black'); // ['red', 'green', 'black'] colors.pushObject(['yellow']); // ['red', 'green', ['yellow']] Parameters: obj * object to push Returns: object same object passed as a param

MutableArray#addObject()

addObject (obj) Ember.Arraypublic Inherited from Ember.MutableEnumerable but overwritten in packages/ember-runtime/lib/mixins/mutable_array.js:379 Push the object onto the end of the array if it is not already present in the array. let cities = ['Chicago', 'Berlin']; cities.addObject('Lima'); // ['Chicago', 'Berlin', 'Lima'] cities.addObject('Berlin'); // ['Chicago', 'Berlin', 'Lima'] Parameters: obj * object to add, if not already present Returns: Ember.Array receiver

MutableArray#clear()

clearEmber.Arraypublic Defined in packages/ember-runtime/lib/mixins/mutable_array.js:87 Remove all elements from the array. This is useful if you want to reuse an existing array without having to recreate it. let colors = ['red', 'green', 'blue']; color.length(); // 3 colors.clear(); // [] colors.length(); // 0 Returns: Ember.Array An empty Array.

MutableArray#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);

Models

Introduction Models are objects that represent the underlying data that your application presents to the user. Different apps will have very different models, depending on what problems they're trying to solve. For example, a photo sharing application might have a Photo model to represent a particular photo, and a PhotoAlbum that represents a group of photos. In contrast, an online shopping app would probably have different models, like ShoppingCart, Invoice, or LineItem. Models tend to be pe

Mixin.create()

create (arguments) publicstatic Defined in packages/ember-metal/lib/mixin.js:503 Parameters: arguments