css set property with data attribute
div::after {
content: attr(data-whatever);
}
css set property with data attribute
div::after {
content: attr(data-whatever);
}
Angular - dynamically set model property of object bound to radio button based on its state
function setTrueFalseRadioState(answer) {
angular.forEach(vm.files, function (a) {
if (a.IsMyChoice !== answer.IsMyChoice) {
a.IsMyChoice = false;
}
});
};
vm.setTrueFalseRadioState = setTrueFalseRadioState;
I discovered that if you want to send the object data to the backend server, you need to set the ng-value to its index
<input type="radio"
id="isChoice_{{$index + 1}}"
name="response"
ng-value="{{$index + 1}}"
ng-required="!file.IsMyChoice"
ng-change="get.setTrueFalseRadioState(file)"
data-ng-model="file.IsMyChoice" />
and the use javascript to check the values like:
if (file.IsMyChoice !== undefined) {
file.IsMyChoice !== false ?
file.IsMyChoice = 'true' : file.IsMyChoice = 'false';
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us