AngularJS selecting multiple options

前端 未结 1 1283
说谎
说谎 2020-12-24 08:00

So, What I\'m trying to do is fairly simple with vanilla JS, but I\'m using AngularJS and I would like to know how to do it the best way within the framework. I want to upda

1条回答
  •  温柔的废话
    2020-12-24 08:06

    ngModel is pretty awesome! If you specify the indexes as a model selectedValues

     UI to build your list, I'd suggest refactoring the data (or using another $watch but those can be expensive).

    Yes, selectedValues needs to contain strings, not numbers. (At least it did for me :)

    Full example at http://jsfiddle.net/JB3Un/

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