I currently have a table that displays checkbox elements when clicked by the user. However, after clicking the checkbox, nothing is being displayed.
<td ng-switch="user.scope">
<span class="label label-primary" ng-switch-when="1">Admin</span>
<span class="label label-primary" ng-switch-when="2">App</span>
<span class="label label-primary" ng-switch-when="3">Redemption</span>
</td>
Below is the code for the checkbox element in my modal form:
<label for="scope">Scope</label><br>
<input type="checkbox" ng-model="user.scope.admin" name="scope[]" value="1"> Admin <br>
<input type="checkbox" ng-model="user.scope.app" name="scope[]" value="2"> App <br>
<input type="checkbox" ng-model="user.scope.redemption" name="scope[]" value="3"> Redemption <br>
In addition, here is the javascript portion of the code:
$scope.users = [{username: "a", name:"b", password:"c", confirmpassword:"d", status:"0", scope:"1" }];
$scope.addUser = function(user) {
$dialog.open({
showClose: false,
closeByEscape: true,
template: 'views/user/user-user-add.html',
controller: ['$scope', function ($dialogScope) {
$dialogScope.isLoading =false;
$dialogScope.title = "New User";
$dialogScope.user = {
username : "" ,
name : "",
password :"",
confirmpassword :"",
status : "",
scope : {},
};
$dialogScope.add = function() {
console.log($dialogScope.user);
$scope.users.push($dialogScope.user);
$dialogScope.closeThisDialog();
}