给定模板
<script type="text/x-handlebars">
{{#link-to 'test' (query-params test=0)}}link{{/link-to}}
</script>
和脚本
App = Ember.Application.create();
App.Router.map(function() {
this.resource('test');
});
App.TestController = Ember.ArrayController.extend({
queryParams: ['test'],
test: null
});
当我点击时,查询参数没有显示在网址中,如下所示 http://emberjs.jsbin.com/qawoza/1/edit 。我做错了什么?
最佳答案
当您在 jsbin 中以编辑器模式查看它时,输出位于它自己的 iframe 中。如果您弹出实时预览,您将看到您的查询参数。
关于javascript - 查询参数未保留在 Ember.js 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26456172/