【发布时间】:2017-02-09 04:22:02
【问题描述】:
我知道 ember 应该有一些内置的 binding of controller properties and query params。文档状态(参考前面的例子):
once the articles route has been entered, any changes
to the category query param in the URL will update the
category property on controller:articles, and vice versa.
我认为“反之亦然”的意思是,如果控制器属性之一发生更改,它也会反映在 URL 上的 QP 中。也许我误解了这一点。但如果我的解释是正确的(可能不是),那并不是实际发生的事情。
我整理了一个twiddle来演示
有没有办法将 url 上的 QP 绑定到控制器属性,以便
a) 如果 url QP 更新,控制器属性会更新
b) 如果控制器属性更新,则位置栏中的 QP 会更新
?
任何帮助表示赞赏
【问题讨论】:
标签: ember.js