angularjs - Changing the data source of ui select on event -
i want change data source of select each time select new.
this how markup of directive looks:
<ui-select on-select="fclick($item,$model)" on-remove="rclick($item,$model)" reset-search-input="true" close-on-select="true" multiple ng-model="namesmodel.selected" theme="select2" ng-disabled="disabled" style="width: 100%;"> <ui-select-match placeholder="select user...">{{$item.name}}</ui-select-match> <ui-select-choices repeat="user in users"> <div ng-bind-html="user.name | highlight: $select.search"></div> </ui-select-choices> </ui-select>
for example: initial source like: scope.users = [{name:"user1",address:"address1"},{name:"user2",address:"address2"}]
whenever select user1 want call rest service , change value of scope.users
or change whole source if possible.
the issue on fclick
this:
'somesvc.getnewdatasource().then(function (data) { scope.users = data; })'
but doesn't change source. missing here?
Comments
Post a Comment