[英]Dynamic pages in ember
I have ember.js and json : 我有ember.js和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.
在导航中找到2并创建2个动态页面,当您第一次单击时,您会看到带有Workshop类型的列表。我在google中搜索此书,但没有发现类似的问题。如果没有问题,请给我一些示例。 Somebody help me with this?
有人帮助我吗?
Tnx for help! Tnx寻求帮助! :)
:)
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 这是一个工作箱: http : //emberjs.jsbin.com/keguq/2/edit
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.