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

isEmpty doesn't check for empty objects #2146

Open
Grohden opened this issue Jul 4, 2018 · 0 comments
Open

isEmpty doesn't check for empty objects #2146

Grohden opened this issue Jul 4, 2018 · 0 comments

Comments

@Grohden
Copy link

Grohden commented Jul 4, 2018

I'm currently having problems to show my placeholder, my default model is a empty object, and i need it that way. But ui select doesn't validate empty objects.

Here are the lines that validate that:

ui-select/dist/select.js

Lines 366 to 368 in 32829a3

ctrl.isEmpty = function() {
return isNil(ctrl.selected) || ctrl.selected === '' || (ctrl.multiple && ctrl.selected.length === 0);
};

A equals comparation would solve that angular.equals(ctrl.selected, {}) and show the placeholder.

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

1 participant