第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

在api上提交表單的post方法

在api上提交表單的post方法

千萬里不及你 2021-10-21 16:42:07
角 8 上有一個(gè)表格我的form.component.html<div class="container"><form novalidate [formGroup]="registrationForm">    <div class="form-group">        <label for="firstName">Имя:</label>        <input #spy required pattern=[A-Za-zА-Яа-яЁё]{2,} name="firstName" id="firstName" type="text" class="form-control" formControlName="firstName">    </div>    <div class="form-group">        <label for="lastName">Фамилия:</label>        <input #spy required pattern=[A-Za-zА-Яа-яЁё]{2,} name="lastName" id="lastName" type="text" class="form-control" formControlName="lastName">    </div>    <div class="form-group">        <label for="email">E-mail:</label>        <input #spy required email name="email" id="email" type="email" class="form-control" formControlName="email">    </div>    <!--{{ spy.className }}-->    <button type="submit" class="btn btn-succes" (click)="submit(myForm)">Отправить</button></form>當(dāng)用戶寫入數(shù)據(jù)時(shí),提交按鈕應(yīng)使用 POST 方法向 API 發(fā)送數(shù)據(jù)。如果您需要任何代碼,請(qǐng)發(fā)表評(píng)論ts 代碼:import { FormGroup, FormControl } from '@angular/forms';import {HttpClient} from '@angular/common/http';@Component({  selector: 'app-my-form',  templateUrl: './my-form.component.html',  styleUrls: ['./my-form.component.css']})export class MyFormComponent implements OnInit {  registrationForm: FormGroup;  constructor() { }  ngOnInit() {    this.registrationForm = new FormGroup({      firstName: new FormControl(),      lastName: new FormControl(),      email: new FormControl()    });  }}```
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 536 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)