手记

Angularjs实现select的下拉列表

练习使用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

 

运行效果动态演示:

 

0人推荐
随时随地看视频
慕课网APP