在angularjs中传递选项的值

时间:2014-08-04 20:47:17

标签: angularjs select option

我正在尝试将所选选项的值传递给我的ng更改功能。下面显示的是我的代码

 <select ng-model="this.value" ng-change="showExecutionStepOptions(study.id,acase.id,this.value)">
                                        <option value='acase.executionSteps[0].id' selected=selected>TOPPER</option>
                                        <option value='acase.executionSteps[1].id'>RSC</option>
                                        <option value='acase.executionSteps[2].id'>SPD</option>
                                        <option value='acase.executionSteps[3].id'>SFT</option>
                                        <option value='acase.executionSteps[4].id'>LMP</option>
                                     </select>

有人可以告诉我什么是正确的语法?

1 个答案:

答案 0 :(得分:0)

请参见此处:http://jsbin.com/xoyuf/1/

HTML:

JS:

var app = angular.module('app', []);

app.controller('firstCtrl', function($scope){
 $scope.acases = [
   {id:1, value:"TOPPER"},
   {id:2, value:"RSC"},
   {id:3, value:"SPD"},
   {id:4, value:"SFT"},
   {id:5, value:"LMP"},
 ];
});