I am using angucomplete-alt to show dropdown search. Its working fine.But in one case I want to set its value from controller. I tried
$scope.selectedCustomer.title = $scope.customerList[1].businessName
& also
$scope.selectedMerchant = $scope.merchantList[1]
But the both didn't work. In the angucomplete-alt documentation its written that there is two way binding. Can any one help me out in displaying default selection..
Not sure if you ever found an answer to this but I thought I would share how I achieved this.
<angucomplete-alt id="owner"
placeholder="[email protected]"
pause="400"
selected-object="subscription.EmailAddress"
initial-value="{{subscription.EmailAddress}}"
Initial value accepts a string value, using angular syntax I was able to generate this from the controller using curly brackets.
Hope this helps.
I was using angucomplete-alt along with ui-bootstrap's modal I tried a lot, ended up doing this:
$timeout(function(){
$scope.$broadcast('angucomplete-alt:changeInput', 'myType', myTypeVal);
}, 200);
..and the html was
<angucomplete-alt id="myType" placeholder="My Type"
pause="400" selected-object="myTypeSelectedFn"
remote-url="/searchMyType"
remote-url-request-formatter="searchMyTypeFn"
search-fields="name" title-field="code"
input-class="form-control form-control-small"
match-class="angucomplete-highlight"
name="myType" minlength="1" field-required="true"
field-required-class="alert-danger"
text-searching="Fetching.." auto-match="true"
ng-model="modifiedMy.type"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With