当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Validators.minLength方法代码示例

本文整理汇总了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
        });
    }
开发者ID:isman-usoh,项目名称:followork,代码行数:29,代码来源:register.ts

示例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);
 }
开发者ID:kam2001,项目名称:motor,代码行数:7,代码来源:register.component.ts

示例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'];
    }
开发者ID:PhilippeAMAT,项目名称:Ionic2,代码行数:9,代码来源:login.ts

示例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'];
    }
开发者ID:drews256,项目名称:Ionic2Angular2,代码行数:10,代码来源:login.component.ts

示例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'];  
    }
开发者ID:karimessouabni,项目名称:DsicApp,代码行数:10,代码来源:formcnx.ts

示例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'];
    }
开发者ID:lzielinski03,项目名称:ionicbesy,代码行数:10,代码来源:login.ts

示例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'];  
    }
开发者ID:tecnicoEA,项目名称:Validacion,代码行数:11,代码来源:home.ts

示例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');
  }
开发者ID:AlmeroSteyn,项目名称:Angular2-Playground-Bootstrap,代码行数:11,代码来源:qa-validators-demo.component.ts

示例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();
        }
    }
开发者ID:mducnguyen,项目名称:TicklrClient,代码行数:51,代码来源:auth.component.ts

示例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)]
    })
  }
开发者ID:EliuFlorez,项目名称:app-picture,代码行数:14,代码来源:login.ts


注:本文中的@angular/common.Validators.minLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。