我正在尝试在组合框中初始化数据,并且尝试了所有可能的方法,但没有:
<select ng-init= "account.username = githubaccounts[0].username" data-ng-model="account" data-ng-options="account.username for account in githubaccounts"
class="btn btn-default" data-container="body">
</select>
<div class="form-group" ng-show="account.username == 'Other'">
<label for="groupNameTxt">Group Name:</label>
<input type="text" class="form-control" name="groupNameTxt" id="groupNameTxt" placeholder="Enter Group Name..." ng-model="group.groupName">
</div>
它的其他工作方式是:
<select class="btn btn-default" data-container="body"
ng-init="githubaccounts[0].username" ng-model="account">
<option ng-repeat="account in githubaccounts" value="">
{{account.username}}
</option>
</select>
但是,然后, ng-show 不起作用:
有任何想法吗?非常感谢。