- this.userAddForm = new ControlGroup({
- username: new Control('', Validators.compose([ Validators.required, Validators.minLength(3), Validators.maxLength(20) ])),
- password: new Control('', Validators.compose([ Validators.required, Validators.minLength(6) ])),
+ this.userAddForm = new FormGroup({
+ username: new FormControl('', [ <any>Validators.required, <any>Validators.minLength(3), <any>Validators.maxLength(20) ]),
+ password: new FormControl('', [ <any>Validators.required, <any>Validators.minLength(6) ]),