Reputation: 877
I have ember.js and json :
"id": 150,
"position": 2,
"talk_group_id": 5,
"type": "workshop",
with two types : workshops or presentation. I want display in one page only models with one types.
If it is possible I want to do this dynamic.. E.g. ember check types. Find 2 and create 2 dynamic pages in navigate and when you click first you seen list with type workshop.. I search this in google and I don't find similar problem.. If it no problem please give me some example. Somebody help me with this?
Tnx for help! :)
Upvotes: 1
Views: 48
Reputation: 2592
You should be able to use a computed property and filter all the model based on the type by doing something like:
App.IndexController = Ember.ArrayController.extend({
workshops: Ember.computed.filterBy('','type','workshop'),
presentations: Ember.computed.filterBy('','type','presentation'),
});
Here is a working bin: http://emberjs.jsbin.com/keguq/2/edit
Upvotes: 2