I recently started using AngularJS and I'm attempting to bind the object "Optouts.Spouse" to checkboxes that are being ng-repeated from the Plans object.
In my JS, I have:
$scope.optouts = { spouse: {}, children: {} };
$scope.plans = {mec:true;anotherone:true};
And in my HTML, I have:
<span ng-repeat="(plan,x) in plans">{{plan}}
<input type="checkbox" ng-model="optouts.spouse.plan"
ng-checked="!optouts.spouse.plan">
</span>
However, it seems like the binding is not working as expected. Can anyone point out what I might be doing wrong or suggest a solution to make this work? Thank you!
There's really not much more to show..
their.plans = {};
their.toggles = {};
their.optouts = { spouse: {}, children: {} };
their.optouts = { spouse: {'mec':true}, children: {} };
their.spouse = { has:true,
firstName: 'Mary',
lastName:'Doe',
birthDate:'8/10/1989',
gender:'Female' }
their.plans = { mec:true, mr1: true, anotherone:true }