本文整理汇总了TypeScript中@angular/common.Validators.minLength方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Validators.minLength方法的具体用法?TypeScript Validators.minLength怎么用?TypeScript Validators.minLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/common.Validators
的用法示例。
在下文中一共展示了Validators.minLength方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
private events: Events,
private nav: NavController,
private auth: AuthProvider,
private formBuilder: FormBuilder) {
this.name = new Control("", Validators.compose([
Validators.required,
Validators.minLength(6),
Validators.maxLength(64)
]));
this.email = new Control("", Validators.compose([
Validators.required,
Validators.pattern("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$"),
Validators.minLength(6),
Validators.maxLength(64)
]));
this.password = new Control("", Validators.compose([
Validators.required,
Validators.minLength(6),
Validators.maxLength(24)
]));
this.registerForm = formBuilder.group({
"name": this.name,
"email": this.email,
"password": this.password
});
}
示例2: constructor
constructor(private _carservice:CarsService,fb:FormBuilder,private _router:Router){
this.registerForm = fb.group({
username:['',Validators.compose([Validators.required,Validators.minLength(5)])],
password:['',Validators.compose([Validators.required,Validators.minLength(5)])]
})
console.log(this.registerForm.controls);
}
示例3: ngOnInit
ngOnInit() {
this.authForm = this.fb.group({
'username': ['', Validators.compose([Validators.required, Validators.minLength(3)])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(3)])]
});
this.username = this.authForm.controls['username'];
this.password = this.authForm.controls['password'];
}
示例4: constructor
constructor(private navController: NavController, private fb: FormBuilder, private http: Http) {
this.userForm = fb.group({
'username': ['', Validators.compose([Validators.required, Validators.minLength(8)])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(8)])]
});
this.username = this.userForm.controls['username'];
this.password = this.userForm.controls['password'];
}
示例5: constructor
constructor(private navController: NavController, private fb: FormBuilder) {
this.authForm = fb.group({
'email': ['', Validators.compose([Validators.required, Validators.minLength(8), Formvalidator.checkEmail])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(8), Formvalidator.checkFirstCharacterValidator])]
});
this.email = this.authForm.controls['email'];
this.password = this.authForm.controls['password'];
}
示例6: constructor
constructor(public nav: NavController, private fb: FormBuilder, private authService:AuthService) {
this.auth = authService;
this.authForm = fb.group({
'username': ['', Validators.compose([Validators.required, Validators.minLength(8), LoginValidator.checkFirstCharacterValidator])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(8), LoginValidator.checkFirstCharacterValidator])]
});
this.username = this.authForm.controls['username'];
this.password = this.authForm.controls['password'];
}
示例7: constructor
constructor(private navController: NavController , private fb: FormBuilder) {
this.navController=navController;
this.authForm = fb.group({
'username': ['', Validators.compose([Validators.required, Validators.minLength(4), CustomValidators.checkFirstCharacterValidator])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(4), CustomValidators.checkFirstCharacterValidator])]
});
this.username = this.authForm.controls['username'];
this.password = this.authForm.controls['password'];
}
示例8: ngOnInit
ngOnInit() {
this.demoForm = this.formBuilder.group({
'someNumber': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])],
'someNumberStyle': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])],
'someNumberObject': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])]
});
this.someNumber = this.demoForm.find('someNumber');
this.someNumberStyle = this.demoForm.find('someNumberStyle');
this.someNumberObject = this.demoForm.find('someNumberObject');
}
示例9: ngOnInit
ngOnInit() {
this.ctrlEmail = new Control('', Validators.compose([Validators.required, Validators.pattern("^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$")]));
this.ctrlPassword = new Control('', Validators.compose([
Validators.required, Validators.minLength(8), Validators.maxLength(255),
]));
this.ctrlRegPassword = new Control('', Validators.compose([
Validators.required,
Validators.minLength(8),
Validators.maxLength(255),
]));
this.ctrlRegPasswordConfirm = new Control('', (password:AbstractControl) => {
return password.value != this.ctrlRegPassword.value ? {passwordConfirmation: 'Password confirmation does not match'} : null;
});
this.loginForm = new ControlGroup({
password: this.ctrlPassword,
email: this.ctrlEmail
});
this.registerForm = new ControlGroup({
email: this.ctrlEmail,
password: this.ctrlRegPassword,
passwordConfirm: this.ctrlRegPasswordConfirm
});
this.isLogin = true;
this.wrongEmailPassword = false;
this.regEmailConflict = false;
this.otherErrorLogin = false;
// redirect to the previous page if user is logged in
this._authContext.observable().subscribe(
(authContext:AuthContext) => {
if (authContext.isLoggedIn()) {
this.goBack();
}
}
);
if (this._authContext.isLoggedIn()) {
this.goBack();
}
}
示例10: constructor
constructor(
public platform: Platform,
public nav: NavController,
public authData: AuthData,
public formBuilder: FormBuilder
) {
this.nav = nav;
this.authData = authData;
this.loginForm = formBuilder.group({
email: ['', Validators.required, Validators.minLength(6), Validators.maxLength(64)],
password: ['', Validators.required, Validators.minLength(6), Validators.maxLength(24)]
})
}