如果此問題很愚蠢,我很抱歉。我已經開始在前端工作,並且非常喜歡它。 我被困在一個點,我想要在ember js控制器中導入句柄模板,並將它附加到div。如何在控制器中導入車把模板並將其放置在另一個車把模板中
所以如何在控制器中導入句柄模板並填充它並將其放置在另一個句柄模板中。
這裏是我的控制器:
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
search: function() {
alert("done");
}
}
});
這裏是車把模板:
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Mark</th>
<th>Subject</th>
</tr>
</thead>
<tbody>
{{#each students}}
<tr>
<td>{{ this.name }}</td>
<td>{{ this.mark }}</td>
<td>{{ this.subject }}</td>
</tr>
{{/each}}
</tbody>
</table>
我已經發布的代碼在GitHub和網址爲:https://github.com/focode/emberjs2/tree/master/app