在编辑模式下选中了动态复选框

时间:2019-04-23 10:04:04

标签: angular typescript

我无法选中我的复选框,也无法切换为“ true”。

请对此提供帮助,我无法弄清楚我做错了什么地方。

我正在使用“切换”复选框

我尝试过* ngIf条件,当我得到true记录时显示true,否则为false

from exchangelib import DELEGATE, Configuration, GSSAPI
from exchangelib.protocol import BaseProtocol, NoVerifyHTTPAdapter
from exchangelib import Account, ServiceAccount
import extract_msg
import logging.handlers
import os
import winkerberos as kerberos
from datetime import datetime


#connecting to Exchange

user='administrator@xy.test'
password='secret!@#'
BaseProtocol.HTTP_ADAPTER_CLS = NoVerifyHTTPAdapter

config = Configuration(
    server='172.16.41.206',
    credentials = ServiceAccount(username=user, password=password),
    auth_type = GSSAPI
    )

account = Account(
    primary_smtp_address='administrator@xy.test',
    autodiscover=False,
    config=config,
    access_type=DELEGATE)

<link rel="import" href="../bower_components/polymer-sortablejs/polymer-sortablejs.html"/>
<link rel="import" href="../bower_components/paper-slider/paper-slider.html">

<dom-module id="demo">
  <template>      
    <h3>TEST- Sortable JS & Paper-Slider</h3>

    <sortable-js>
        <paper-slider min="0" max="1" step="0.01"></paper-slider>
    </sortable-js>

  </template>

  <script>
    Polymer({
      is: "demo"
    });
  </script>
</dom-module>

我的浏览器控制台值enter image description here

1 个答案:

答案 0 :(得分:0)

我这样解决了, 将名称属性设置为唯一集

           <div *ngIf="item.ischecked==true">
                                                    <label class="switch switch-3d switch-primary">
                                                    
                                                            <input type="checkbox"   [(ngModel)]="item.ischecked"  checked="true"  name="ischecked{{item.PageId}}"   class="switch-input">
                                                            <span class="switch-slider"></span>
                                                        </label>
                                            </div>

                                            <div *ngIf="item.ischecked==false">
                                                    <label class="switch switch-3d switch-primary">
                                                            <input type="checkbox"   [(ngModel)]="item.ischecked"  checked="false"  name="ischecked{{item.PageId}}"     class="switch-input">
                                                            <span class="switch-slider"></span>
                                                        </label>
                                            </div>