samedi 2 janvier 2016

Ember Computed Sort by date

I am trying to sort by date the repositories 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:desc'],
sortedRepos: Ember.computed.sort('model', 'sortProperties')

in My Template

{{#each model.commits in sortedRepos}}
   <li>{{this.message}}</li>
   <li>{{format-date "LL" this.data}}</li>
{{/each}}

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

P.s I am using an helper template with moment js




Aucun commentaire:

Enregistrer un commentaire