How I added default sorting in my Ember.js application
1807 단어 Ember.js
The solution
diff --git a/app/controllers/shows.js b/app/controllers/shows.js
index b387bf5..94845aa 100644
--- a/app/controllers/shows.js
+++ b/app/controllers/shows.js
@@ -1,4 +1,6 @@
export default Ember.ArrayController.extend({
+ sortProperties: ['title'],
+ sortAscending: true,
modalId: null,
modalTitle: null,
modalEpisode: null,
Done.Conclusion
Because of the hard work of the folks at Ember.js, I was able to leverage the code already available in the Ember.sortableMixin class just by supplying attributes in my controller .
When I first saw this online, I couldn't believe that I didn't have to do anything to get sorting done. Just one of the many nice things about working with Ember.
My (very simple) Ember.js application is available on Github here . Demo here .
Screenshot:
Reference
이 문제에 관하여(How I added default sorting in my Ember.js application), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/kimagure/items/5e7d50250c716e766383텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)