简体   繁体   中英

Dynamic pages in ember

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.. Eg 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! :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM