Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4826

Can Ember.A() contain numbers/strings or it is suitable only for objects?

$
0
0

@marxsk wrote:

I’m trying to find out if Ember.A() can be used also with non-Objects. In the documentation, ethe strings are used in Enumerables together with pushObject() [e.g. in https://guides.emberjs.com/v2.16.0/object-model/enumerables/]

But when I try to add an empty string (as with push()), the value is not added. When I try to do replace, the item is removed from the array.

let arr = Ember.A(['first', 'second', 'third']);

arr.replace(0, 1, 'new-first');
arr.replace(1, 1, '');

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4826

Trending Articles