这是我的HTML代码
<div ng-controller="formController">
<form>
<div class=btn-group>
<div class="dropdown top-buttons">
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<span class="menu-item" ng-model="model.shiftID">Shift</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li><a role="menuitem" href="#">E</a></li>
<li><a role="menuitem" href="#">L</a></li>
<li><a role="menuitem" href="#">N</a></li>
</ul>
</div>
</div>
<button type="submit" class="btn btn-success select-submit" ng-click="getCall()">GO!</button>
</form>
</div>
角度JS控制器代码
.controller("formController", function ($scope)
{
// when initialized only the initial value is displayed
// in the alert. But the passed value through
// ng-model directive is still undefined
$scope.model = {shiftID: "init"};
$scope.getCall = function () {
alert($scope.model.shiftID)
}
.....
}
我已经完成了其他一些解决方案,但尚未能解决。