最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ng-options with track by and filters - Stack Overflow

programmeradmin9浏览0评论

Hey so I need to populate my select box with a list of Regions from Json object. There are duplicates in here that I would like to remove and I have set the alphabetical order.

I also need to use track by job.WS_REGION so that the value is set to the region just now I think it is tracking index so assigning a number to the value.

Can track by be used in conjunction with filters?

They work perfect independent of each other either by assigning value or applying filters.

<select ng-model="filterzz" ng-options="job.WS_REGION for job in jobsfull track by job.WS_REGION | orderBy: 'WS_REGION' | unique:'WS_REGION'">

If this is a simple mistake go easy on me its a Friday afternoon :)

Hey so I need to populate my select box with a list of Regions from Json object. There are duplicates in here that I would like to remove and I have set the alphabetical order.

I also need to use track by job.WS_REGION so that the value is set to the region just now I think it is tracking index so assigning a number to the value.

Can track by be used in conjunction with filters?

They work perfect independent of each other either by assigning value or applying filters.

<select ng-model="filterzz" ng-options="job.WS_REGION for job in jobsfull track by job.WS_REGION | orderBy: 'WS_REGION' | unique:'WS_REGION'">

If this is a simple mistake go easy on me its a Friday afternoon :)

Share Improve this question asked Sep 12, 2014 at 14:05 craigie2204craigie2204 3613 silver badges13 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 21

Try parentheses:

ng-options="job.WS_REGION for job in (jobsfull | orderBy: 'WS_REGION' | unique:'WS_REGION') track by job.WS_REGION"
发布评论

评论列表(0)

  1. 暂无评论