Initial/Default value in ng-repeat
- 主要语言
- JavaScript
- 星标
- 2.9k
- 派生
- 319
- PR 合并指标
- 30 天内没有已合并 PR
描述
My code:
```
User 1 {{value}}
```
Scenario:
I use combination of filterBy and countBy filter to get drop down value. The default drop down value is set to **User 1**, its changes when the user selects a value from drop-down and later the value can never be **User 1** Example (Default value is User 1 drop-down value is hi,hello,hey. Once user selects either of these values the ddvalue1 field gets updated in DB and user can in future only select value available in drop-down)
The purpose of using the filter above is to display a badge. As the user selects the value from drop down the badge value decrease. Example I have 5 drop-down all set to User 1 initially, hence badge value is 5, once a new drop-down value is selected the the badge value decreases to 4.
The problem is when **all** the value of drop down is changed the filterBy filter can't find User 1 and as such the count value is not updated. So instead of getting 0 nothing gets displayed. Is there a way to set default values ?
I tried my best to explain, i have attached image as well. I have written same filter for another drop-down, the only thing changes is default value to **User 2.** As u can see in the image the panel should display value of badges as 1 and 0 for user 1 and user 2 respectively, but since it can't find the filter it displays nothing. I tried using tertiary operator while displaying the output but im not sure what should i compare the *_value *_ too {{ value > 0 ? value : 0}}

贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。