One concrete example is a component I created that looks like this.
@Component({
selector: 'home',
template:
`
<form (ngSubmit)="onSubmit(f)" #f="ngForm">
<input type="text" ngControl="people">
<input type="text" ngControl="people">
<input type="submit">
</form>
`
})
export class Home {
onSubmit(f) {
console.log(f.value);
}
}
After entering "tom" and "bob" into each form field and clicking the "Submit" button, the console displays:
Object {people: "bob"}
However, my intended output would be:
Object {people: ["tom", "bob"]}
I wonder if it's possible to achieve an array value using ngForm?