Ember.js size from DS.ManyArray
How to do it? Plain JS .length
returns undefined.
+3
xamenrax
source
to share
2 answers
Try .get('length');
this instead because it ManyArray
is a little more special. I just use .get('length');
all the time these days in Ember to prevent problems like this, otherwise you will just find a confusion between .get('length');
and .length
.
+10
Wildhoney
source
to share
For any Ember array, you will need to use .get ('length'). Just wanted to clarify that this is not unique to ManyArray.
+3
Alex white
source
to share