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

An empty array should be considered as the empty value for multiple mode... #335

Closed
wants to merge 1 commit into from
Closed

An empty array should be considered as the empty value for multiple mode... #335

wants to merge 1 commit into from

Conversation

osmirnov
Copy link

.... ngOptions directive has the same behavior:

angular/angular.js#2365
angular/angular.js#5337

@konrad-garus
Copy link

+1: Looks very straightforward and is an annoying bug/behavior.

Meanwhile a monkey patch for the impatient:

directive('nonEmptyArray', function () {
    return {
        require: 'ngModel',
        link: function (scope, element, attrs, ngModelCtrl) {
            var original = ngModelCtrl.$isEmpty;
            ngModelCtrl.$isEmpty = function (value) {
                return original.call(ngModelCtrl, value) || value.length === 0;
            };
        }
    }
});

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

Successfully merging this pull request may close these issues.

2 participants