私はこのテーブルをユーザがクリックしたチェックボックスの表示要素にします。しかし、ユーザーがチェックボックスをクリックすると、何も表示されなくなります。テーブルの表示チェックボックスの入力にエラーがあります
<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>
これは私のモーダルフォームのチェックボックス要素です。
<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>
これはjavascriptの部分です。それだけで一つの式の値に依存しているので、あなたがng-switch
を使用することはできません複数選択の場合
$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();
}
は、あなたがオブジェクト –
としてそれを持って、これはコントローラからですが、それはしないでください@ArunPJohnyのスコープに表示する : オブジェクト scope3 : true – sue