我创建了下拉列表,它有2个值:1)Value1
2)Value2
我想选择Value1
作为下拉列表中的默认值。我创建了以下内容,但它只是硬编码Value1
而不是重定向到Value1
<div class="col-md-4" style="margin-right:10px;">
<button class="btn btn-default dropdown-toggle" type="button"
id="dropdownMenu1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
Value1
<span class="caret"> </span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1" ng-model="auditToggle">
<li><a ng-click="methodName('/method1')">Value1</a> </li>
<li><a ng-click="methodName('/method2')">Value2</a> </li>
</ul>
</div>
尝试
<li [value]="'Value1'"><a ng-click="methodName('/method1')">Value1</a> </li>
<li [value]="'Value2'"><a ng-click="methodName('/method2')">Value2</a> </li>