Dynamically assign ng-model

前端 未结 5 1339
一整个雨季
一整个雨季 2020-11-29 19:49

I\'m trying to generate a set of check-boxes from an object array. I\'m aiming to have the check-boxes dynamically map their ng-model to a property of the new object that wi

5条回答
  •  一生所求
    2020-11-29 20:29

    With Angular 1.3, you can use ng-model-options directive to dynamically assign the model, or bind to an expression.

    Here is a plunkr: http://plnkr.co/edit/65EBiySUc1iWCWG6Ov98?p=preview


    More info on ngModelOptions here: https://docs.angularjs.org/api/ng/directive/ngModelOptions

提交回复
热议问题