Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS-TypeError:$element.find(…)。每个都不是函数_Javascript_Angularjs_Spring Boot_Datatables - Fatal编程技术网

Javascript AngularJS-TypeError:$element.find(…)。每个都不是函数

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

我试图在angularJS中使用datatable。 以下是我的HTML代码:

   <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());
        });