feat(forms): added support for arrays of controls
This commit is contained in:
15
modules/angular2/test/forms/form_builder_spec.js
vendored
15
modules/angular2/test/forms/form_builder_spec.js
vendored
@ -60,5 +60,18 @@ export function main() {
|
||||
expect(g.controls["login"].validator).toBe(Validators.nullValidator);
|
||||
expect(g.validator).toBe(Validators.group);
|
||||
});
|
||||
|
||||
it("should create control arrays", () => {
|
||||
var c = b.control("three");
|
||||
var a = b.array([
|
||||
"one",
|
||||
["two", Validators.required],
|
||||
c,
|
||||
b.array(['four'])
|
||||
]);
|
||||
|
||||
expect(a.value).toEqual(['one', 'two', 'three', ['four']]);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user