这就是我如何使用名为 Create 的接口以角度调用补丁 api
1> 这是我的 apiService.ts 代码
const postData : Create = {
"address": {
"city": "string",
"addressDetails": "string",
"pincode": "string",
"state": "string",
"country": "string"
},
"bankName": "string",
"branch": "string",
}
2> 这是我的 Component.ts 代码
getPatchBankAPI(postData : Create , postForm : NgForm){
this.patchService.getPatchBank(
postData.bankName,
postData.branch,
postData.address,
)
3> 这是我的 HTML 代码
<div class="col-md-6">
<div class="form-row">
<div class="value">
<div class="input-group">
<input class="input--style-5" type="text" class="form-control"
id="bankName"
required
ngModel
name="bankName" placeholder="Bank Name">
</div>
</div>
</div></div>
<div class="col-md-6">
<div class="form-row">
<div class="value">
<div class="input-group">
<input class="input--style-5" type="text" class="form-control"
id="branch"
required
ngModel
name="branch" placeholder="Bank Branch">
</div>
</div>
</div></div>
<div class="col-md-6">
<div class="form-row">
<div class="value">
<div class="input-group">
<input class="input--style-5" type="text" class="form-control"
id=" city "
required
ngModel
name=" city " placeholder="Bank Address">
</div>
</div>
</div></div>
现在我的问题是,如果我想将城市名称作为输入,那么我应该写什么:id="" required ngModel name="" id required ng model and name ?? 像 address.city 或直接 city ,我试过直接写 city 但我的 api 不接受它