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

Chips don't sync when item is removed #34

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions