Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.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向表数据添加过滤器选项_Javascript_Angularjs_Html - Fatal编程技术网

Javascript 使用AngularJS向表数据添加过滤器选项

Javascript 使用AngularJS向表数据添加过滤器选项,javascript,angularjs,html,Javascript,Angularjs,Html,我已经创建了一个包含静态数据的html表,现在我想使用angularjs向表数据添加过滤器选项 我试过这个: <input type="search" placeholder="Filter" ng-model="searchtext"/> <br/><br/> <table class="table table-hover"> <thead> <th>Name</th> <th

我已经创建了一个包含静态数据的html表,现在我想使用angularjs向表数据添加过滤器选项

我试过这个:

<input type="search" placeholder="Filter" ng-model="searchtext"/> <br/><br/>

<table class="table table-hover">
   <thead>
     <th>Name</th>
     <th>Version</th>
     <th>Type</th>
   </thead>
   <tbody id="Table" class="tbody">
     <tr ng-repeat="filter:searchtext | orderBy: 'name'">
       <td>link</td>
       <td>4</td>
       <td>L1 Type</td>
     </tr>
   </tbody>
</table> 


名字 版本 类型 链接 4 L1型
您的
ng repeat
缺少数组信息。应该从项目中的
item | filter…
之类的内容开始,你在下面的线程中尝试过@malkus的答案吗?我不想使用角度控制器的值,而是从表中获取值查看文档:它确切地告诉你如何按顺序排序,正如@charlietfi所说的,您缺少数组@you不能在原始html表上使用
ng repeat
。。这个概念是有缺陷的。请更详细地解释表格来源和期望值。最糟糕的情况是,您可以将html解析为数据数组,但这似乎非常落后