小编D3v*_*v30的帖子

选中的属性在 mat-radio-button 中不起作用

我正在创建一个带有选中属性的单选按钮,但它没有显示选中

<mat-radio-group name="radioOpt1" [(ngModel)]="selectedRadio" [ngModelOptions]="{standalone: true}" (change)="radioChange($event)">
<mat-radio-button value="own" checked name="own">Own</mat-radio-button>
<mat-radio-button value="competitor" name="own">competitor</mat-radio-button> </mat-radio-group>
Run Code Online (Sandbox Code Playgroud)

我希望默认选中第一个单选按钮

angular-material angular7

4
推荐指数
1
解决办法
1万
查看次数

从 formArray 中删除 FormControl

我创建了我的 FormGroup 如下

this.GSTNForm = this.formbuilder.group({
      gstRegistrationStatusId: new FormControl(''),
      reasonForNonApplicabilityofGST: new FormControl(''),
      isExemptGoods: new FormControl(false),
      goodServiceRemarks: new FormControl(''),
      gstandbankDetails: this.formbuilder.array([
        this.formbuilder.group({
          _id: new FormControl(''),
          sequenceNo: new FormControl(this.gstnSequenceValue),
          gstn: new FormControl(''),
          addressline1: new FormControl(''),
          addressLine2: new FormControl(''),
          stateCode: new FormControl(''),
          cityCode: new FormControl(''),
          countryCode: new FormControl(''),
          pinCode: new FormControl(''),
          accountHolderName: new FormControl(''),
          accountTypeId: new FormControl(''),
          bankName: new FormControl(''),
          branchName: new FormControl(''),
          bankCountryCode: new FormControl(''),
          accountNo: new FormControl(''),
          ifscCode: new FormControl(''),
          micrCode: new FormControl(''),
          swiftCode: new FormControl('')
        })
      ])
    });
Run Code Online (Sandbox Code Playgroud)

我有些想删除_id …

typescript angular angular-reactive-forms

2
推荐指数
1
解决办法
6921
查看次数

在 routerLinkActive="active" 上更改按钮内子垫图标的颜色

我的网页上有一个带有项目列表的标题,每个项目都有一个垫子图标子项。以下是其中一项。

<a [routerLink]="[ '/admin' ]" > 
   <button routerLink="['/admin']" routerLinkActive="active">
       <mat-icon color="warn">history</mat-icon>Audit
   </button>
</a>
Run Code Online (Sandbox Code Playgroud)

CSS 在routerLinkActive="active"按钮文本上工作正常,但我也想更改 mat-icon 的颜色,但似乎没有任何效果

html css angular-ui-router angular-material angular

0
推荐指数
1
解决办法
8169
查看次数