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


TypeScript common.FormBuilder类代码示例

本文整理汇总了TypeScript中@angular/common.FormBuilder的典型用法代码示例。如果您正苦于以下问题:TypeScript FormBuilder类的具体用法?TypeScript FormBuilder怎么用?TypeScript FormBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: constructor

  constructor() {
    super();

    let fb = new FormBuilder()
    this.partyForm = fb.group({
      name: ['', Validators.required],
      description: ['', Validators.required],
      location: ['', Validators.required]
    });
  }
开发者ID:Hongbo-Miao,项目名称:angular2-meteor-universal,代码行数:10,代码来源:party-form.ts

示例2: constructor

  constructor(private productService: ProductService) {
    this.categories = this.productService.getAllCategories();

    const fb = new FormBuilder();
    this.formModel = fb.group({
      'title': [null, Validators.minLength(3)],
      'price': [null, positiveNumberValidator],
      'category': ['']
    })
  }
开发者ID:Singulus2,项目名称:medi,代码行数:10,代码来源:search.ts

示例3: constructor

 constructor(fb: FormBuilder) {
     this.interviewForm = fb.group({
         interview: fb.group({
             candidate: fb.group({
                 firstName: ['', Validators.required],
                 lastName: ['', Validators.required]
             })
         })
     })
 }
开发者ID:Anhmike,项目名称:RecruitX-Frontend-Angular2,代码行数:10,代码来源:newInterview.component.ts

示例4: constructor

  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.forgetForm = fb.group({
      email: ['']
    });

    this.error = '';
  }
开发者ID:Feldor,项目名称:society,代码行数:11,代码来源:forget.ts

示例5: constructor

  constructor(params: RouteParams) {
    var partyId = params.get('partyId');
    this.party = Parties.findOne(partyId);

    let fb = new FormBuilder();
    this.partyForm = fb.group({
     name: [''],
     description: [''],
     location: ['']
    });
  }
开发者ID:ijager,项目名称:Socially-Step8,代码行数:11,代码来源:party-details.ts

示例6: constructor

 constructor() {
   const fb = new FormBuilder();
   this.formModel = fb.group({
     'username': ['', Validators.required],
     'ssn': ['', ssnValidator],
     'passwordsGroup': fb.group({
       'password': ['', Validators.minLength(5)],
       'pconfirm': ['']
     }, {validator: equalValidator})
   });
 }
开发者ID:AviFix,项目名称:angular2typescript,代码行数:11,代码来源:07_form-builder.ts

示例7: constructor

  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.recoverForm = fb.group({
      email: ['', Validators.required]
    });

    this.error = '';
  }
开发者ID:DavyDuDu,项目名称:meteor-angular2.0-socially,代码行数:11,代码来源:recover.ts

示例8: constructor

  constructor(private router: Router) {
   // super();

    let fb = new FormBuilder();

    this.signupForm = fb.group({
      email: ['', Validators.required],
      password: ['', Validators.required]
    });

    this.error = '';
  }
开发者ID:Anhmike,项目名称:angular2-shop,代码行数:12,代码来源:signup.ts

示例9: constructor

  constructor(private router: Router) {
    super();

    let fb = new FormBuilder();

    this.loginForm = fb.group({
      username: [''],
      password: ['']
    });

    this.error = '';
  }
开发者ID:Feldor,项目名称:society,代码行数:12,代码来源:login.ts

示例10: ngOnInit

 ngOnInit() {
   this.form = this.formBuilder.group({
     committeeYear: ['', Validators.required],
     newMember: this.formBuilder.group({
       name: ['', Validators.required]
     })
   });
   this.organogramId = this.routeSegment.getParam('organogramId');
   this.committeeYear = '';
   this.newMember = {name: ''};
 }
开发者ID:ohanspace,项目名称:ng2-badhan-web,代码行数:11,代码来源:committee-create.component.ts


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