Bind JSON object to radio button in angularjs

前端 未结 3 2063
迷失自我
迷失自我 2021-02-05 14:21

So I am trying to bind radio buttons to objects. I have spent like an hour trying to figure this up and at last admit defeat. Here\'s what I got:

3条回答
  •  时光说笑
    2021-02-05 14:46

    It is because of the scope inheritance, you can read more about the problem here.

    One solution that I use in such a case, is to bind the object to an object property instead of a primitive value like ng-model="form.currentCustomer".

    Demo: Plunker

提交回复
热议问题