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.

ng-model not updating with 1.3rc3 #243

Open
@brianchance

Description

@brianchance

Using angular 1.3 rc3, my ng-model is never updated.

Code...

<ui-select multiple ng-model="vm.model.roles">
    <ui-select-match placeholder="Select Roles...">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="role.roleId as role in vm.roles">{{role.name}}</ui-select-choices>
</ui-select>

When the call to ngModel.$setViewValue is made, the ngModel.$viewValue is already the newValue (as well as ngModel.$$lastCommittedViewValue).

Tracing through $setViewValue to $$debounceViewValueCommit, then to $commitViewValue, it returns without parsing and validating if $$lastCommittedViewValue === viewValue.

Not sure why the ngModel already has the newValue. I see your note about the 3rd parameter forcing revalidate, but that is not there in 1.3 rc3. Maybe a call to ngModel.$$validate?

Side question - what is the preferred method of validating contents like other input elements?

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