Angularjs自动生成表格Table
1、使用场景:
(1)使用Augularjs请求后台,查询记录,将返回的记录以表格的形式进行显示;
(2)对表格进行编辑时,数据回显
2、使用方式
(1)方式1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="myApp">
<table ng-controller="myCtrl" border="1">
<tr ng-repeat="x in records">
<td>{
{x.Name}}</td>
<td>{
{x.Country}}</td>
<td>{
{x.address}}</td>
<td>{
{x.job}}</td>
</tr>
<tr style="border:0px" id="tr" ng-repeat="x in records">
<td>
<select name="merchant" id="merchant" ng-model="data.merchantNo">
<option value="">请选择供应商</option>
<option ng-repeat="a in x.Name" value="{
{a.url}}" selected>{
{a.site}}</option>
</select>
</td>
<td>
<select name="category" id="category" ng-model="data.categoryNo">
<option value="">请选择权益分类</option>
<option ng-repeat="a in x.Country" value="{
{a.url}}" selected>{
{a.site}}</option>
&