简体   繁体   English

多种模型合为一条路线,并进行Ember选择过滤

[英]Multiple models into one route and filtering for Ember select

I have two models loading into one route (edit page) through the setupController function. 我有两个模型通过setupController函数加载到一条路由(编辑页面)中。 This is because the page is using a dynamic segment. 这是因为页面正在使用动态段。 Within the edit page, I also have a select dropdown list which is populated via another api ("options" API). 在编辑页面中,我还有一个选择下拉列表,该列表通过另一个api(“ options” API)填充。

I'm having trouble using the filter to filter through the api and then applying it to the ember select element. 我在使用过滤器过滤api并将其应用于ember select元素时遇到了麻烦。 When I try and filter, I get an error. 当我尝试过滤时,出现错误。 I can't seem to filter through the options API. 我似乎无法通过选项API进行过滤。

Here is a jsbin to demonstrate my problem: http://emberjs.jsbin.com/salivo/3/ 这是一个jsbin来演示我的问题: http ://emberjs.jsbin.com/salivo/3/

Performing the async lookup and setting the two lists through the setupController entirely, instead of via computed controller functions, works just fine 执行异步查找并完全通过setupController而不是通过计算的控制器功能来设置两个列表,就可以了

http://jsbin.com/pahezivuli/2/edit?html,js,output http://jsbin.com/pahezivuli/2/edit?html,js,输出

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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