Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Chips don't sync when item is removed #34

Open
ghost opened this issue May 17, 2017 · 0 comments
Open

Chips don't sync when item is removed #34

ghost opened this issue May 17, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented May 17, 2017

For example:

<div ng-controller="MyCtrl">
<chips data-ng-model="tags">
      <chip-tmpl>
           <div class="default-chip">
                   {{ chip }}
                   <span remove-chip="removeTag(data)"><i class="fa fa-times-circle" aria-hidden="true" style="cursor: pointer;"></i></span>
            </div>
      </chip-tmpl>
      <input ng-model-control placeholder="Select tags..." data-ng-model="tag" typeahead-on-select="onSelectTag($item, $model, $label, $event)" uib-typeahead="tag for tag in tags | filter:$viewValue" />
 </chips>
</div>

The problem is that if from the MyCtrl I remove the item from $scope.tags the chip dom element does not get removed as well, it remains. but if I remove the item clicking the cross the item syncs with $scope.tags model.

What I'm trying to achieve is not letting the users to select duplicated tags and reflect that in the displayed chips.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants