Javascript AngularJS-TypeError:$element.find(…)。每个都不是函数
我试图在angularJS中使用datatable。 以下是我的HTML代码:Javascript AngularJS-TypeError:$element.find(…)。每个都不是函数,javascript,angularjs,spring-boot,datatables,Javascript,Angularjs,Spring Boot,Datatables,我试图在angularJS中使用datatable。 以下是我的HTML代码: <div ng-app="datatable"> <div ng-controller="voucherlistcontroller"> <table class="table table-bordered&qu
<div ng-app="datatable">
<div ng-controller="voucherlistcontroller">
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"
my-table="overrideOptions"
aa-data="voucherList"
ao-column-defs="columnDefs"
fn-row-callback="myCallback" >
<thead>
<tr>
<th>VIN Date</th>
<th>VIN No</th>
<th>Receive Type</th>
<th>Amount</th>
<th>Particulars</th>
<th>Posted</th>
<th>Status</th>
<th>Preview</th>
</tr>
</thead>
<tbody ng-repeat = " vlist in voucherList">
<tr>
<td>{{vlist.vindate}}</td>
<td>{{vlist.vinno}}</td>
<td>{{vlist.receivetype}}</td>
<td>{{vlist.amount}}</td>
<td>{{vlist.particulars}}</td>
<td>{{vlist.posted}}</td>
<td>{{vlist.status}}</td>
<td>{{vlist.preview}}</td>
</tr>
</tbody>
</table>
</div>
</div>
但它不被视为元素的函数。它显示-TypeError:element.find(…)。每个都不是对象上的函数。
但我想我已经给出了html页面上的所有参考资料。参考文献列表如下所示:
- JQuery-1.9.0
- JQUery迁移1.2.1.js
- bootstrap.bundle.min.js
- jquery-ui.min.js
我怎样才能解决这个问题?请帮忙 发生错误是因为元素是dom元素而不是jQuery对象。它将是:
$(element).find('th').each(function(index, elem) {
explicitColumns.push($(elem).text());
});
而不是:
element.find('th').each(function(index, elem) {
explicitColumns.push($(elem).text());
});
element.find('th').each(function(index, elem) {
explicitColumns.push($(elem).text());
});