本文整理汇总了TypeScript中angular2/forms.FormBuilder类的典型用法代码示例。如果您正苦于以下问题:TypeScript FormBuilder类的具体用法?TypeScript FormBuilder怎么用?TypeScript FormBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormBuilder类的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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论