一开始是使用原生js实现
原生js实现民族下拉选择框
但到了数据交互的时候,不知道什么原因,不能使用了,所以改成用angularjs
<div ng-app="myapp" ng-controller="getDatas">
<select name="nation" ng-init="item.nation" ng-model="item.nation" ng-options="x for x in nation"> </select>
</div>
var app = angular.module('myapp', []);
app.controller("getDatas", ['$scope', '$http', '$filter', function ($scope, $http, $filter) {
// 获取信息列表
$http({
url: '/***/***/***',//这里是接口链接
method: 'POST',
data: {
//这里可添加要传递的参数
},
}).success(function (response) {
console.log(response);
if (JSON.parse(response).key