本文整理匯總了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]
});
}
示例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));
}
示例3: constructor
constructor(builder: FormBuilder) {
this.form = builder.group({
fullName: ["", Validators.required],
username: ["", Validators.required],
favColor: [""]
});
}
示例4: constructor
constructor(builder: FormBuilder, private resortsEP: ResortsEP) {
this.createResortForm = builder.group({
name: ["", Validators.required]
});
this.created = new EventEmitter();
}
示例5: constructor
constructor(builder:FormBuilder) {
// this.builder = FormBuilder;
this.contactForm = builder.group({
name: ["", Validators.required]
});
console.log(this.contactForm);
}
示例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;
}
示例7: constructor
constructor(
public formBuilder: FormBuilder,
public todoService: TodoService) {
this.todoForm = formBuilder.group({
'todo': ['', Validators.required]
});
this.todoInput = this.todoForm.controls.todo;
}
示例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]
}
)
}
示例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;
}
示例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;
}