Answer the question
In order to leave comments, you need to log in
Why doesn't ngModel work in ngRepeat?
Hello! Tell me why the model in the input field does not work ..
<label ng-repeat="(key, val) in datas.options.sex">
<input
type="checkbox"
ng-true-value="key"
ng-false-value="null"
ng-model="filter.sex[key]"
/> {{val}}
</label>
Answer the question
In order to leave comments, you need to log in
It seems like ng-repeat creates its own scope. Try ng-model="$parent.filter.sex[key]"
thanks so he began to perceive the model, but another problem appeared
<div ng-repeat="(key, val) in datas.options.sex">
<label>
<input
type="checkbox"
ng-true-value="1"
ng-false-value="null"
ng-model="$parent.filter.sex[key]"
/> {{val}}
</label>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question