Hi there,
simple challenge,
I got a model that I want the length of it and I already tried the
this.store.all('body').get('length'); but it didn’t work for me
How can I get the model length and where should I write the codes ? thanks

this.store.all('body') In the route returns a promise. What you need is probably a controller property like this.get('model.length') or use the hook afterModel() { return this.modelFor('body').get('length'); } in your route.

Good suggestions, remember that (1) afterModel already has the resolved model passed in as argument, and (2) OP probably needs the length in his template and by then the model will be resolved so model.length will work in the template

Uh , after all it only worked this way, I wrote down this code : setupController: function(controller, model) { controller.set('length',this.get('model.length')); }
in my Body route and it gave me the number 2 ! which is wrong. maybe I wasn’t clear in my questioning .I have Body record which there are some names in it (currently 5 names) I just want to get this number (damn 5) but it gave me 2 instead.