Dynamically assign ng-model

前端 未结 5 1338
一整个雨季
一整个雨季 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:15

    This is my approach to support deeper expression, e.g. 'model.level1.level2.value'

    
    

    where item.modelPath = 'level1.level2' and Utility(model, 'level1.level2') is the utility function that returns model.level1.level2

提交回复
热议问题