我尝试使用 javascript document.querySelector 从角度检索值。我能够检索输入字段值,但是当我来到单选按钮、切换和选择框时,我无法检索值。我无法使用检索值
(document.querySelector('.recurring_subscription') as HTMLInputElement).value
(document.querySelector('.given_to') as HTMLInputElement).value
(document.querySelector('.billing_state') as HTMLInputElement).value
<mat-slide-toggle class="mat-toggle-nusa" class="recurring_subscription" formControlName="recurring_subscription">
Automatic donate this amount once every Month
</mat-slide-toggle>
<mat-radio-button *ngFor="let dt of nusa_given" class="given_to" [value]='dt.value' > {{dt.name}} </mat-radio-button>
<mat-select formControlName="billing_state" class="billing_state" placeholder="Enter State (required)">
<mat-option *ngFor="let state of getNameOfStates | async" [value]="state.abbreviation">
{{ state.abbreviation }}
</mat-option>
</mat-select>