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


TypeScript FormBuilder.group方法代碼示例

本文整理匯總了TypeScript中angular2/forms.FormBuilder.group方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormBuilder.group方法的具體用法?TypeScript FormBuilder.group怎麽用?TypeScript FormBuilder.group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular2/forms.FormBuilder的用法示例。


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

示例1: constructor

 constructor(protected formBuilder: FormBuilder,
   protected userService: UserDataService) {
   this.form = this.formBuilder.group({
     name: ['', Validators.required],
     email: ['', Validators.required]
   });
 }
開發者ID:Brocco,項目名稱:ng2-play,代碼行數:7,代碼來源:edit-user.ts

示例2: constructor

	constructor(b: FormBuilder, contracts: Contracts){
		this.exContr = new ExContr();
		
		this.exContr.contract = 'zcb';
		this.exContr.arg1 = 3.0;
		this.exContr.arg2 = 10;
		this.exContr.image = true;
		
		this.contractJson = "{}"
		this.latticeImage = ""
		this.expectedValueChart = ""

		this.builder = b;
		this.contracts = contracts;
		
		this.exContrForm = this.builder.group({
			contract: [this.exContr.contract],
			arg1: [this.exContr.arg1],
			arg2: [this.exContr.arg2],
			image: [this.exContr.image],
		});
		
		
		
		// this.exContrForm.valueChanges.forEach( ()=> this.exContrForm.writeTo(this.exContr));
	}
開發者ID:yuriylesyuk,項目名稱:scala-contracts-client,代碼行數:26,代碼來源:contracts.ts

示例3: constructor

 constructor(builder: FormBuilder) {
   this.form = builder.group({
     fullName: ["", Validators.required],
     username: ["", Validators.required],
     favColor: [""]
   });
 }
開發者ID:evertonrobertoauler,項目名稱:babel-angular2-app,代碼行數:7,代碼來源:form.ts

示例4: constructor

 constructor(builder: FormBuilder, private resortsEP: ResortsEP) {
   this.createResortForm = builder.group({
     name: ["", Validators.required]
   });
   
   this.created = new EventEmitter();    
 }
開發者ID:data-avail,項目名稱:rb-index,代碼行數:7,代碼來源:resort-create-form.ts

示例5: constructor

    constructor(builder:FormBuilder) {
        // this.builder = FormBuilder;
        this.contactForm = builder.group({
            name: ["", Validators.required]
        });

        console.log(this.contactForm);
    }
開發者ID:ludohenin,項目名稱:angular2-demo-app,代碼行數:8,代碼來源:contact-form.ts

示例6: constructor

	constructor(public formBuilder: FormBuilder){
		this.loginForm = formBuilder.group({
			'login': ['', Validators.required],
			'password':['']
		})

		this.loginUsername = this.loginForm.controls.login;
		this.loginPassword = this.loginForm.controls.password;
//this.loginUsername = this.loginForm.controls.loginUsername;
}
開發者ID:JamesUlph,項目名稱:angular2-webpack-starterOLD,代碼行數:10,代碼來源:login.ts

示例7: constructor

  constructor(
    public formBuilder: FormBuilder,
    public todoService: TodoService) {

    this.todoForm = formBuilder.group({
      'todo': ['', Validators.required]
    });
    this.todoInput = this.todoForm.controls.todo;

  }
開發者ID:oneredorange,項目名稱:angular2-webpack-starter,代碼行數:10,代碼來源:todo.ts

示例8: constructor

	constructor(partiesService: PartiesService, fb: FormBuilder) {
		this.partiesService = partiesService;
		this.parties = this.partiesService.parties;
		this.party = fb.group(
			{
				title: ['', Validators.required],
				description: ['', Validators.required]
			}
		)
	}
開發者ID:ibhi,項目名稱:angular2-parties-app,代碼行數:10,代碼來源:app.ts

示例9: constructor

  constructor(public router:Router,
              public formBuilder:FormBuilder,
              public http:Http) {

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

    this.emailInput = this.loginForm.controls.email;
    this.passwordInput = this.loginForm.controls.password;

  }
開發者ID:thomasschulze,項目名稱:fooddiary-angular2,代碼行數:13,代碼來源:login.ts

示例10: constructor

    constructor(public router:Router, public bookService:BookService, public formBuilder: FormBuilder) {
        this.book = new Book();
        this.createFailedMsg = null;
        this.canShowCreateFailedMsg = false;

        this.createBookForm = formBuilder.group({
            'isbn': ['', Validators.required],
            'title': ['', Validators.required],
            'author': [''],
            'publicationDate': ['']
        });

        this.isbnInput = this.createBookForm.controls.isbn;
        this.titleInput = this.createBookForm.controls.title;
        this.authorInput = this.createBookForm.controls.author;
        this.publicationDateInput = this.createBookForm.controls.publicationDate;
    }
開發者ID:elf-mouse,項目名稱:ts.ng,代碼行數:17,代碼來源:create-book.ts


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