我最近开始学习emberJS,但我在做一些基本的事情时遇到了问题,而这些事情我在不使用这个框架的情况下会做。我遇到的主要问题是使用jquery 插件,在这种情况下是 jquery数据表
在我的组件的 component.js 中
import Ember from 'ember';
export default Ember.Component.extend({
    didInsertElement: function(model){
        Ember.run.scheduleOnce('afterRender', this, function(model) {
            this.$(".datatables").DataTable();
        });
    }
});
在我组件的 template.hbs
<table class="table table-hover datatables">
    <thead>
        <tr>
            <th>Course Name</th>
            <th>Course Title</th>
            <th class="text-center">Actions</th>
        </tr>
    </thead>
    <tbody>
        {{#each courses as |course|}}
        <tr>
            <td> {{ course.name }} </td>
            <td> {{ course.title }} </td>
            <td  class="text-center"> {{#link-to 'courses.edit' course }} Edit {{/link-to}} </td>
        </tr>
        {{/each}}
    </tbody>
</table>
**然后我使用了这样的组件:- **
{{#course-datatable courses=model}}{{/course-datatable}}
我将不胜感激附有答案的演示。
干杯