来自路线的Ember.js数据不会显示在模板中

时间:2016-05-18 04:14:48

标签: javascript ember.js

as you can see, hbs has a placeholder for {{abcd}} and route returns the value for abcd but my page does not show that data. When i do a view source, i can see that js function is carried into the page! Am I missing something? do I need to write something in controller folder before route and model/template can talk to each other?

如您所见,hbs有{{abcd}}的占位符,路由返回abcd的值,但我的页面没有显示该数据。当我做一个视图源时,我可以看到js函数被带入页面!我错过了什么吗?在路由和模型/模板可以相互通信之前,是否需要在控制器文件夹中编写内容?

1 个答案:

答案 0 :(得分:2)

模板对路由属性一无所知。 {{abcd}}会引用控制器属性。要访问它,您必须通过控制器的模型属性{{model.abcd}}

我建议你仔细看看guides