Function

Module: @ember/utils

Available since v2.16.4

returns
EmberArray

Creates an Ember.NativeArray from an Array like object. Does not modify the original object's contents. Ember.A is not needed if EmberENV.EXTEND_PROTOTYPES is true (the default value). However, it is recommended that you use Ember.A when creating addons for ember or when you can not guarantee that EmberENV.EXTEND_PROTOTYPES will be true.

Example

component.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import Component from '@ember/component';

export default Component.extend({
  tagName: 'ul',
  classNames: ['pagination'],

  init() {
    this._super(...arguments);

    if (!this.get('content')) {
      this.set('content', Ember.A());
    }
  }
});