我有一个Spring Boot应用程序。我更改每个发布请求的请求正文。是否可以在请求到达控制器之前修改请求主体。请列举一个例子。
在我的角度项目中有角度材料并使用mat-select.Mat-select是我的表格设置自动对焦的第一个元素,而页面已成功加载,但我无法在mat-select上设置自动对焦.任何人都可以帮我找到在mat-select中设置自动对焦的方法.
@ViewChild("name") nameField: ElementRef;
ngOninit() {
this.nameField.nativeElement.focus();
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div>
<mat-select [(ngModel)]="nameField" #name>
<mat-option *ngFor="let option of options2" [value]="option.id">
{{ option.name }}
</mat-option>
</mat-select>
</div>
Run Code Online (Sandbox Code Playgroud)