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


TypeScript Validators.compose方法代码示例

本文整理汇总了TypeScript中angular2/common.Validators.compose方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Validators.compose方法的具体用法?TypeScript Validators.compose怎么用?TypeScript Validators.compose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在angular2/common.Validators的用法示例。


在下文中一共展示了Validators.compose方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(public nav: NavController, fb: FormBuilder) {
   this.nav = nav;
   this.memberForm = fb.group({
     fullname: ["",Validators.required],
     username: ["",Validators.required],
     //password: ["",Validators.required]
     password: ["",Validators.compose([Validators.required,Validators.minLength(8)])] // required password 8 charactor
   });
 }
开发者ID:bameeman,项目名称:MyFirstApp,代码行数:9,代码来源:user.ts

示例2: constructor

 constructor(fb: FormBuilder, public addressService: Addresses, private router: Router) {
     this.editAddressForm = fb.group({
         'mail': ['', Validators.compose([
             Validators.required, mailValidator])],
         'firstName': ['', Validators.required],
         'lastName': ['', Validators.required],
         'country': ['', Validators.required]
     });
 }
开发者ID:szymon-wiatr,项目名称:angular2-address-book,代码行数:9,代码来源:index.async.ts

示例3: constructor

 constructor(fb:FormBuilder) {
     this.form = fb.group({
         username: ['', Validators.compose([
             Validators.required,
             UsernameValidators.cannotContainSpace
         ]), UsernameValidators.shouldBeUnique], // shouldBeUnique is an async validator
         password: ['', Validators.required]
     });
 }
开发者ID:toefel18,项目名称:angular2-exercises,代码行数:9,代码来源:signup-form.component.ts

示例4: constructor

  constructor(signupform: FormBuilder, private _http: Http, private httpservice: HttpService, private _router: Router) {

      this.SignupForm  = signupform.group({
          "username": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
          "firstname": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
          "lastname": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
          "email": ["",  Validators.compose([Validators.required, CustomFromValidation.EmailValidation])],
          "password": ["", Validators.compose([Validators.required, Validators.minLength(3)])],
          "confirmPassword": ["", Validators.required]
      });
      this.username = this.SignupForm.controls["username"];
      this.firstname = this.SignupForm.controls["firstname"];
      this.lastname = this.SignupForm.controls["lastname"];
      this.email = this.SignupForm.controls["email"];
      this.password = this.SignupForm.controls["password"];
      this.confirmPassword = this.SignupForm.controls["confirmPassword"];

  }
开发者ID:MOHAMMADArsalan,项目名称:SalemanApp_ng02,代码行数:18,代码来源:signup.component.ts

示例5: constructor

	constructor(fb: FormBuilder){
		this.form = fb.group({
			username: ['',Validators.compose([
					Validators.required,
					UsernameValidators.cannotContainSpace
			])],
			password: ['',Validators.required]
		})
	}
开发者ID:krjijeesh88,项目名称:ang2,代码行数:9,代码来源:signup-form.component.ts

示例6: constructor

 constructor(fb: FormBuilder){
     this.form = fb.group({
         username:['',Validators.compose([
             Validators.required, 
             UsernameValidators.cannotContainSpace
             ]), UsernameValidators.shouldBeUnique], //this array can take 3 params: default value, 1 or more custom synchronous validators, 1 or more async validators
         password:['',Validators.required]
     })
 }
开发者ID:mderfler,项目名称:advanced-forms-example,代码行数:9,代码来源:signup-form.component.ts

示例7: ngOnInit

 ngOnInit(){
     this.myForm = this._fb.group({
         email: ['',Validators.compose([
             Validators.required,
             this.isEmail
         ])],
         password: ['',Validators.required]
     });
 }
开发者ID:biharck,项目名称:udemy-node-angular2,代码行数:9,代码来源:signin-component.ts

示例8: constructor

 constructor(fb:FormBuilder,private _router:Router){
   this.form = fb.group({
     username:['',Validators.compose([
       Validators.required,
       UsernameValidators.cannotContainSpace]
     ),UsernameValidators.shoudBeUnique],
     password:['',Validators.required]
   })
 }
开发者ID:kamiranoff,项目名称:angular2,代码行数:9,代码来源:complex-form.component.ts

示例9: constructor

  constructor(app: IonicApp, nav: NavController, dbService: DBService, fb: FormBuilder, userService: UserService) {

    this.dbService = dbService;
    this.userService = userService;
    this.app = app;
    this.nav = nav;
    this.form = fb.group({
      matchingPassword: fb.group({
        password: ['', Validators.required],
        passwordConfirm: ['', Validators.required]
      }, { validator: this.areEqual }),
      email: new Control('', Validators.compose([Validators.required, this.isEmail])),
      firstName: new Control('', Validators.required),
      lastName: new Control('', Validators.required),
      mobile: new Control('', Validators.compose([Validators.required, this.isPhoneNumber]))
    });
    this.signupData = {};
  }
开发者ID:marcelpetersen,项目名称:football-planer,代码行数:18,代码来源:signup.ts

示例10: constructor

 constructor(fb: FormBuilder) {
     this.skuForm = fb.group({
         'sku': ['',
                 Validators.compose([
                     Validators.required,
                     skuValidator
                 ])]
     });
 }
开发者ID:kencbarrett,项目名称:angular2-forms,代码行数:9,代码来源:demo-form-with-custom-validations.ts


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