練習使用angularjs實現一個select下拉列表: <div ng-app="selectApp" ng-controller="selectController"> <select ng-model="mySelect" ng-options="sd for sd in selectData ...
<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