这是我的控制权
<mat-form-field class="example-full-width">
<input type="text" placeholder="Role Name" aria-label="Number" matInput formControlName="rolename" [matAutocomplete]="rolename" >
<mat-autocomplete #rolename="matAutocomplete">
<mat-option *ngFor="let option of roleAllList" [value]="option.roleName" [attr.roleId]="option.roleId" [attr.roleDesc]="option.roleDescription" (onSelectionChange)="populateRoleDesc(option.roleDescription)">
{{option.roleName}}
</mat-option>
</mat-autocomplete>
</mat-form-field>
在此函数populateRoleDesc中,I m receiving the value of roleDescription and setting to another control, rather than using a function for is it possible to set it in HTML itself, I
m使用反应形式
this.form = this.formBuilder.group({
clientid: ['', Validators.required],
role: ['', Validators.required],
});
请告诉我是否有办法。