0
これは私のコードの一部です。角2 rc4:フォームから値を取得できません
<form (ngSubmit)="onSubmit(f)" #f="ngForm">
<label for="city">City</label>
<input ngControl="cityName" type="text" id="city">
<button type="submit">Add City</button>
</form>
export class SearchCity {
onSubmit(form: ControlGroup){
console.log(form.value.cityName);
}
それはUndefined
示しては、どのように私はcityName
の値を得ることができますか?
ありがとう!私はそれを考え出した! – Dan