1
I have a form with some inputs and some checkbox, when I do the search in the database is returned Json, and input fields are filled in but checkbox are not marked although I have declared the ng-model of it:
<p>
<input type="checkbox" name="t0080_pbm_testado" id="t0080_pbm_testado" icheck ng-model="checklist.t0080_pbm_testado" />
<label for="checkbox_demo_1" class="inline-label">Teste</label>
</p>
What’s wrong with it?
View excerpt
<div class="uk-form-row">
class="uk-grid">
<p>
<input type="checkbox" name="t0080_pbm_instalado" id="t0080_pbm_instalado" icheck ng-model="checklist.t0080_pbm_instalado" />
<label for="checkbox_demo_1" class="inline-label">Instalação</label>
</p>
<p>
<input type="checkbox" name="t0080_pbm_configurado" id="t0080_pbm_configurado" icheck ng-model="checklist.t0080_pbm_configurado" />
<label for="checkbox_demo_1" class="inline-label">Configuração</label>
</p>
<p>
<input type="checkbox" name="t0080_pbm_testado" id="t0080_pbm_testado" icheck ng-model="checklist.t0080_pbm_testado" />
<label for="checkbox_demo_1" class="inline-label">Teste</label>
</p>
<p>
<input type="checkbox" name="t0080_pbm_treinado" id="t0080_pbm_treinado" icheck ng-model="checklist.t0080_pbm_treinado" />
<label for="checkbox_demo_1" class="inline-label">Treinamento</label>
</p>
</div>
</div>
angular controller method
$scope.checklist = {};
$scope.getCheckList = function () {
var url = "http://localhost:23714/CheckList/getCheckList?idEmpresa=1&user=a&pass=1";
$http.get(url).success(function (data) {
$scope.checklist = data;
})
};
** inputs are normally filled, checkbox not
Post the code that tries to mark the checkbox please. Use the edit button.
– Marconi
As you are setando
checklist.t0080_pbm_testado
?– Thiago Lunardi
Ah, and how is Json returning from its API?
– Thiago Lunardi
Thiago Lunardi, I edited the post and put the codes there, thanks for while
– alessandre martins