在angular typescript和html中将单个值设置为选定的多个文本字段

在angular typescript和html中将单个值设置为选定的多个文本字段,angular,typescript,input,Angular,Typescript,Input,我重复了多个文本框,并使用复选框选择了多个文本框。在选定的文本框中,我需要在有角度的打字脚本中一次输入相同的值 我曾经给过这样的东西。在我的打字稿中,但不起作用 @ViewChildren("textboxes") textboxes: QueryList<ElementRef>; <div class="liststyle" [hidden]="isSetAggLimit"> <div class="row" *ngFor="le

我重复了多个文本框,并使用复选框选择了多个文本框。在选定的文本框中,我需要在有角度的打字脚本中一次输入相同的值

我曾经给过这样的东西。在我的打字稿中,但不起作用

    @ViewChildren("textboxes") textboxes: QueryList<ElementRef>;

    <div class="liststyle" [hidden]="isSetAggLimit">
        <div class="row" *ngFor="let state of AllState">
            <div class="col-md-4">
                <input #checkboxes type="checkbox" class="form-control" (change)="checkBoxClick(state,'S',$event)"> 
            </div>
            <div class="col-md-4">
                <label class="p-l-4">{{state.stateCode}}</label> 
            </div>
            <div class="col-md-4">
                <input #limitValues class="form-control" placeholder="$" type="text" >
            </div>
        </div>
    </div>
</div>
@ViewChildren(“文本框”)文本框:QueryList;
{{state.stateCode}

我不确定我是否完全理解您的问题,因此如果这不是您想要的,请在可能的情况下举例说明。但是我可以看到这样做的一种方法是检查复选框是否被勾选,然后使用单向数据绑定向输入中注入一个值

<div>
    <input type="checkbox" #checkbox>
</div>
<div>
    <input type="text" [value]="checkbox.checked ? 'Your value or a variable if you want 
    to set it on the typescript file' : ''">
</div>