我正在创建一个带有选中属性的单选按钮,但它没有显示选中
<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)
我希望默认选中第一个单选按钮
我创建了我的 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 …
我的网页上有一个带有项目列表的标题,每个项目都有一个垫子图标子项。以下是其中一项。
<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 的颜色,但似乎没有任何效果