Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ui选择所选不在angularjs中工作_Javascript_Jquery_Angularjs - Fatal编程技术网

Javascript ui选择所选不在angularjs中工作

Javascript ui选择所选不在angularjs中工作,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我目前正在使用AngularJS中的UISelect组件 <ui-select ng-model="tipData.category" search-enabled="false" name="category" required="required" class="orange-site-color-select custom-select"> <ui-select-match><span class="ui-select-result">{{$sele

我目前正在使用AngularJS中的
UISelect
组件

<ui-select ng-model="tipData.category" search-enabled="false" name="category" required="required" class="orange-site-color-select custom-select">
  <ui-select-match><span class="ui-select-result">{{$select.selected}}</span></ui-select-match>
  <ui-select-choices repeat="tipcat in tipCategory"><span ng-bind-html="tipcat.name"></span></ui-select-choices>
</ui-select>

{{$select.selected}
我想知道如何将显示在
ui-select
中的自动选择值实现为从数据库检索数据(仅id)并显示在
ui-select
中?

试试这个

<div ng-controller="DemoCtrl" ng-app="main">
<select ng-model="selectedCountry">
<option value="">Select Account</option>
 <option ng-repeat="x in chooseCountries" value="{{x.countryId}}"  >{{x.name}}</option>
</select>  
</div>
试试这个

<div ng-controller="DemoCtrl" ng-app="main">
<select ng-model="selectedCountry">
<option value="">Select Account</option>
 <option ng-repeat="x in chooseCountries" value="{{x.countryId}}"  >{{x.name}}</option>
</select>  
</div>

您可以使用选定的属性

<div ng-controller="DemoCtrl" ng-app="main">
  <select ng-model="selectedCountry">
<option value="">Select Account</option>
      <option ng-repeat="x in chooseCountries" value="{{x.countryId}}"  selected="{{x.name}}=Malta">{{x.name}}</option>
</select>  
</div>

选择帐户
{{x.name}

您可以使用选定的属性

<div ng-controller="DemoCtrl" ng-app="main">
  <select ng-model="selectedCountry">
<option value="">Select Account</option>
      <option ng-repeat="x in chooseCountries" value="{{x.countryId}}"  selected="{{x.name}}=Malta">{{x.name}}</option>
</select>  
</div>

选择帐户
{{x.name}

我正在使用
ui-select
我正在再次使用
ui-select
我正在再次使用
ui-select
我正在使用
ui-select