34
rated 0 times
[
37]
[
3]
/ answers: 1 / hits: 17283
/ 9 Years ago, thu, december 17, 2015, 12:00:00
While editing the record the data comes in their respective fields for editing, but the checkbox is not checked if its value is 1
.
It should be in checked state if it has 1
and not checked if it has 0
as the datatype of the field is tinyint
. I am retrieving the data from JSON array via PHP. I am trying to get value by ng-checked={{rec.isSpecial}}
but it is not working.
Here is my HTML:
<div class=form-group>
<div class=col-lg-offset-2 col-lg-10>
<div class=checkbox c-checkbox>
<label>
<input type=checkbox ng-checked={{rec.isSpecial}} ng-model=rec.isSpecial>
<span class=fa fa-check></span>Special
</label>
</div>
</div>
</div>
here is my JS
$scope.rec = $resource('api/AdminArea/category/edit/:id', {
id: id
}).get(function(data) {
$scope.rec = data;
});
More From » php