Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

ui-select modifying ng-model object #540

Closed
@ilanbiala

Description

@ilanbiala

With this snippet:

<div class="form-group">
            <label for="users" class="col-sm-3 control-label">Users</label>
            <div class="col-sm-8">
                <ui-select multiple search-enabled ng-model="editingDesk.users" on-remove="editingDesk.removedUsers.has($item) ? editingDesk.removedUsers.delete($item) : editingDesk.removedUsers.add($item)" on-select="editingDesk.newUsers.has($item) ? editingDesk.newUsers.delete($item) : editingDesk.newUsers.add($item)">
                    <ui-select-match placeholder="Select users...">{{$item.userName}}</ui-select-match>
                    <ui-select-choices repeat="user in users | filter: $select.search">
                        {{user.userName}}
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>

When the controller instantiates, editingDesk.users is properly populated. Once the controller finishes instantiating, editingDesk.users.length is 0. If I comment out the HTML above, then I don't have this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions