{"action":"created","issue":{"url":"https://api.github.com/repos/ng-select/ng-select/issues/631","repository_url":"https://api.github.com/repos/ng-select/ng-select","labels_url":"https://api.github.com/repos/ng-select/ng-select/issues/631/labels{/name}","comments_url":"https://api.github.com/repos/ng-select/ng-select/issues/631/comments","events_url":"https://api.github.com/repos/ng-select/ng-select/issues/631/events","html_url":"https://github.com/ng-select/ng-select/issues/631","id":333677722,"node_id":"MDU6SXNzdWUzMzM2Nzc3MjI=","number":631,"title":"Dealing with 0 inside ng select","user":{"login":"LiamDotPro","id":13067327,"node_id":"MDQ6VXNlcjEzMDY3MzI3","avatar_url":"https://avatars3.githubusercontent.com/u/13067327?v=4","gravatar_id":"","url":"https://api.github.com/users/LiamDotPro","html_url":"https://github.com/LiamDotPro","followers_url":"https://api.github.com/users/LiamDotPro/followers","following_url":"https://api.github.com/users/LiamDotPro/following{/other_user}","gists_url":"https://api.github.com/users/LiamDotPro/gists{/gist_id}","starred_url":"https://api.github.com/users/LiamDotPro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiamDotPro/subscriptions","organizations_url":"https://api.github.com/users/LiamDotPro/orgs","repos_url":"https://api.github.com/users/LiamDotPro/repos","events_url":"https://api.github.com/users/LiamDotPro/events{/privacy}","received_events_url":"https://api.github.com/users/LiamDotPro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-19T13:42:40Z","updated_at":"2018-06-20T13:11:39Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nWe are currently using `ng-select` within our production app which relies on a proprietary data layer which we are not able to modify, one of the caveats of this is the following scenario:\r\n\r\n```\r\nTable 1 - foo\r\n------------------\r\nid | categoryId\r\n------------------\r\n1 | 0\r\n2 | 10\r\n```\r\nIn the above table whenever `foo` is created a category is is initialized by default with 0 rather than null, 0 has no category assigned to it within our category table.\r\n\r\nThis leads to the problem where when we receive a view model from the api we are given a foo object that has 0's which means when we do `([ngModel])=\"someObj.category\"` the select box starts with a selected empty field, though the select box functions as intended but we can no longer see the placeholder text initially. I personally do not wish to add further resets that returns our objects field back to null or on creation checks for 0 in over 120 tables worth of view models, it would take forever.\r\n\r\nPotential solution:\r\nI suppose this is a feature request but I was thinking maybe we could expand the functionality of `ng-select` to allow us to set an option (this would default as off ofc) that considers 0 to be unselected or rather doesn't attempt to match a label to a value?\r\n\r\nI'd be more than willing to expand the information here if you have any questions.\r\n\r\n### More Info\r\nng-select version: 2.0.0\r\n\r\nbrowser: Chrome\r\n\r\nreproducible in demo page: N/A\r\n"},"comment":{"url":"https://api.github.com/repos/ng-select/ng-select/issues/comments/398743140","html_url":"https://github.com/ng-select/ng-select/issues/631#issuecomment-398743140","issue_url":"https://api.github.com/repos/ng-select/ng-select/issues/631","id":398743140,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODc0MzE0MA==","user":{"login":"LiamDotPro","id":13067327,"node_id":"MDQ6VXNlcjEzMDY3MzI3","avatar_url":"https://avatars3.githubusercontent.com/u/13067327?v=4","gravatar_id":"","url":"https://api.github.com/users/LiamDotPro","html_url":"https://github.com/LiamDotPro","followers_url":"https://api.github.com/users/LiamDotPro/followers","following_url":"https://api.github.com/users/LiamDotPro/following{/other_user}","gists_url":"https://api.github.com/users/LiamDotPro/gists{/gist_id}","starred_url":"https://api.github.com/users/LiamDotPro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiamDotPro/subscriptions","organizations_url":"https://api.github.com/users/LiamDotPro/orgs","repos_url":"https://api.github.com/users/LiamDotPro/repos","events_url":"https://api.github.com/users/LiamDotPro/events{/privacy}","received_events_url":"https://api.github.com/users/LiamDotPro/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T13:11:38Z","updated_at":"2018-06-20T13:11:38Z","author_association":"NONE","body":"This kind of works, though it's not ideal as the displayed text no longer looks like a placeholder and the X is still present on the select:\r\n\r\n![image](https://user-images.githubusercontent.com/13067327/41660402-d7a482c8-7493-11e8-8fb9-f4d58a6c6b3d.png)\r\n"}}
{"actor":{"display_login":"LiamDotPro"}}