练习使用angularjs实现一个select下拉列表:
<div ng-app="selectApp" ng-controller="selectController"> <select ng-model="mySelect" ng-options="sd for sd in selectData"></select> </div>
Html Code
var selectApp = angular.module('selectApp', []); selectApp.controller('selectController', function ($scope) { $scope.selectData = [ "", "Insus", "Insus.NET", "Leo", "Leo Yang"]; });
JS Code
运行效果动态演示: