當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript forms.FormBuilder類代碼示例

本文整理匯總了TypeScript中@angular/forms.FormBuilder的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormBuilder類的具體用法?TypeScript FormBuilder怎麽用?TypeScript FormBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FormBuilder類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

 constructor(fb: FormBuilder) {
   this.options = fb.group({
     hideRequired: false,
     floatPlaceholder: 'auto',
   });
 }
開發者ID:GuzmanPI,項目名稱:material2,代碼行數:6,代碼來源:form-field-placeholder-example.ts

示例2: constructor

 constructor(fb: FormBuilder) {
     this.myForm = fb.group({
         "sku" : ["", Validators.required]
     });
 }
開發者ID:yjw9012,項目名稱:ng-book-2-forms,代碼行數:5,代碼來源:demo_form_with_validations_shorthand.ts

示例3: constructor

 constructor(fb: FormBuilder) {
   this.options = fb.group({
     'color': 'primary',
     'fontSize': [16, Validators.min(10)],
   });
 }
開發者ID:GuzmanPI,項目名稱:material2,代碼行數:6,代碼來源:form-field-theming-example.ts

示例4: constructor

 constructor(formBuilder: FormBuilder) {
   this._formBuilder = formBuilder;
   this.formGroup = formBuilder.group({});
 }
開發者ID:santech-org,項目名稱:ng-on-rest,代碼行數:4,代碼來源:custom-form-group.component.ts

示例5: constructor

 constructor(fb:FormBuilder) {
     this.myForm = fb.group({
         'username' : [''],
             'userid': ['']
         })
  }
開發者ID:hammadtariq,項目名稱:Angular2-rc-demo,代碼行數:6,代碼來源:formGroup.component.ts

示例6: updateForm

 /**
  * Update the form values
  * @param values
  */
 updateForm(values:Object = {}) {
     this.metricForm = this.fb.group({
         name: [this.selectedMetric.name || '', Validators.required]
     });
 }
開發者ID:danirotzetter,項目名稱:educontrol-main,代碼行數:9,代碼來源:metric.component.ts

示例7: ngOnInit

 ngOnInit() {
   this.myForm = this.formBuilder.group({
     radio: 'C'
   });
 }
開發者ID:OlegDubrovskyi,項目名稱:ngx-bootstrap,代碼行數:5,代碼來源:radio-reactiveforms.ts

示例8: createForm

 /**
  * Creates the forms for the Motion and the MotionVersion
  */
 public createForm(): void {
     this.contentForm = this.formBuilder.group({
         selectedParagraphs: [[], Validators.required],
         reason: ['', Validators.required]
     });
 }
開發者ID:tsiegleauq,項目名稱:OpenSlides,代碼行數:9,代碼來源:amendment-create-wizard.component.ts

示例9: it

    it('should create controls from a boxed value', () => {
      const g = b.group({'login': {value: 'some value', disabled: true}});

      expect(g.controls['login'].value).toEqual('some value');
      expect(g.controls['login'].disabled).toEqual(true);
    });
開發者ID:JanStureNielsen,項目名稱:angular,代碼行數:6,代碼來源:form_builder_spec.ts

示例10: setUpForm

 private setUpForm() {
   this.form = this.formBuilder.group({
     email: [null, [Validators.required, Validators.email]],
     password: [null, Validators.required]
   });
 }
開發者ID:lcmetzger,項目名稱:task-manager-angular,代碼行數:6,代碼來源:sign-in-form.component.ts


注:本文中的@angular/forms.FormBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。