В моей пользовательской таблице есть активное поле вместо true
/ false
Я хочу, чтобы флажок был выделен (это не имеет значения), если true
, и знак минус (не важно), если false
.
И при изменении пользовательских данных я хочу установить один из этих флажков, чтобы установить значение.
Как поставить галочку вместо значения?
<!-- user.html -->
<div class="container" ng-app="app" ng-controller="DashboardCtrl">
<div class="row table-responsive">
<table class="simple-little-table">
<tr>
<th>id</th>
<th>Name</th>
<th>Lastname</th>
<th>Username</th>
<th>email</th>
<th>Role</th>
<th>Active</th>
</tr>
<tr ng-repeat="user in users | filter:$scope.query">
<td>{{ user.id}}</td>
<td>{{ user.firstName}}</td>
<td>{{ user.lastName}}</td>
<td>{{ user.username}}</td>
<td>{{ user.email}}</td>
<td>{{ user.roles}}</td>
<td>{{user.active}}</td>
<td><div>
<button class="btn btn-primary" ng-click="editUser(user.id)">Редактировать</button>
</div></td>
</tr>
</table>
</div>
</div>
это edituser.html
<div class="row">
<div class="col-lg-4 col-sm-12" style="margin: 15px">
Активация:
</div>
<div class="col-lg-6 col-sm-10" style="margin: 5px;">
<textarea style="display: inline-block; width: 100%; height:3rem; resize: none;" ng-model="user.active"
ng-if="editActive"/>
<div ng-if="!editActive" style="display: inline-block; width: 100%; overflow-wrap: break-word">
{{user.active}}
</div>
</div>
<div class="col-lg-1 col-sm-1">
<button ng-click="changeActive()"
ng-if="editActive">
<i class="glyphicon glyphicon-ok"
style="size: 20px"/>
</button>
<button ng-click="changeActive()"
ng-if="!editActive">
<i class="glyphicon glyphicon-pencil"
style="size: 20px"/>
</button>
</div>