samedi 2 janvier 2016

Ember Computed Sort ascending

I am trying to sort by date the repos in GitHub using their JSON API.

I am using Ember 1.13.7

I have reproduced my case in jsbin, the problem is that i can not even see the console error to understand the problem

This is the code applied ( it is commented in the jsbin )

In my controller

sortProperties: ['created_at:asc'],
sortedRepos: Ember.computed.sort('model', 'sortProperties')

in My Template

{{#each model.repos in sortedRepos}}
   <li>{{name}}</li>
   <li>{{format-date "LL" created_at}}</li>
{{/each}}

What' s the error here? how can i sort this model by date ( the latest )?

P.s I am using an helper template {{format-date}} with moment js




Aucun commentaire:

Enregistrer un commentaire