Ember.js 余烬数据访问应用程序初始化
此刻我真的很沮丧。我将尝试用数据库的一些数据填充表。因此,我有一个控制器和一个视图Ember.js 余烬数据访问应用程序初始化,ember.js,Ember.js,此刻我真的很沮丧。我将尝试用数据库的一些数据填充表。因此,我有一个控制器和一个视图 App.TableController.extend({ content: [], contentBinding:'App.incidient.content' }) App.TableView = Ember.CollectionView.extend({ tagName: 'tbody', itemViewClass: Ember.View.extend({ templateNam
App.TableController.extend({
content: [],
contentBinding:'App.incidient.content'
})
App.TableView = Ember.CollectionView.extend({
tagName: 'tbody',
itemViewClass: Ember.View.extend({
templateName: 'table'
})
我的html代码如下所示:
<div class="row-fluid">
<table class="table table-striped">
<thead>
<tr>
<th>
Title
</th>
<th>
Customer
</th>
<th>
Machine
</th>
<th>
Priortity
</th>
<th>
Status
</th>
</tr>
<thead>
{{view App.TableView}}
</table>
</div>
</script>
<script type="text/x-handlebars" data-template-name="table">
{{#each item in content}}
<td>
{{view item.incidient.title}}
</td>
<td>
{{view item.incidient.customer}}
</td>
<td>
{{view item.incidient.machine}}
</td>
<td>
{{view item.incidient.priority}}
</td>
<td>
{{view item.incidient.status}}
</td>
{{/each}}
</script>
标题
顾客
机器
优先权
地位
{{view App.TableView}
{{{#内容中的每个项目}
{{view item.incident.title}
{{view item.incident.customer}}
{{view item.incident.machine}
{{view item.incident.priority}
{{view item.incident.status}
{{/每个}}
我没有因为我的代码不起作用而感到沮丧。更重要的是:
Alex我理解您对过时的教程和示例的不满,但如果有帮助的话,Trek是为了通知文章作者这些事情。关于您的问题,您的
TableController
似乎不正确(您在扩展什么?)。你有没有可能给这个问题添加更多的代码,我看到了一些不太有意义的事情,比如当你在没有循环的情况下调用{{view App.TableView}}
时。我想你应该检查一下:是的,你是对的,我错过了循环。一整天我都在尝试不同的东西,不幸的是感觉像是“尝试并出错”,所以当我发布这篇文章时,我忘了把它改回我真正尝试过的东西。无论如何,非常感谢你的指导。如果你能负担得起,我强烈推荐(仅12美元),希望它能帮助我