AngularJs conditional display for ng-options

后端 未结 3 1904
一整个雨季
一整个雨季 2020-12-15 22:56

I\'ve been searching for a few hours now and I can\'t seem to find the answer for my problem anywhere. I remember that I was able to implement it before but for some reason

相关标签:
3条回答
  • 2020-12-15 23:27

    this works.

    filter:chart.active==false
    

    http://jsfiddle.net/H6AZ2/116/

    0 讨论(0)
  • 2020-12-15 23:30

    Great scott, I think I've got it.

    Instead of:

    filter:chart.active=='false'
    

    It should be:

    filter:chart.active='false'
    

    It's just the number of equal signs used. facepalm

    Thanks for the responses, everyone.

    0 讨论(0)
  • 2020-12-15 23:45

    Hey Instead its better use

    ng-options="chart.id as chart.name for chart in chartList | filter: {active: true}"

    0 讨论(0)
提交回复
热议问题