本文整理汇总了TypeScript中angular2/angular2.FormBuilder类的典型用法代码示例。如果您正苦于以下问题:TypeScript FormBuilder类的具体用法?TypeScript FormBuilder怎么用?TypeScript FormBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FormBuilder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(service: StocksService) {
this.service = service;
this.symbols = service.get();
let builder = new FormBuilder();
this.stockForm = builder.group({
stock: ['']
})
}
示例2: setUpgksitesForm
private setUpgksitesForm(): void{
var formBuilder = new FormBuilder();
this.newgksites = formBuilder.group({
name: ['', Validators.required],
description: [''],
location: ['', Validators.required],
public: [false]
});
}
示例3: constructor
constructor(builder: FormBuilder) {
this.loginForm = builder.group({
login: ["", Validators.required],
passwordRetry: builder.group({
password: ["", Validators.required],
passwordConfirmation: ["", Validators.required]
})
});
}
示例4: constructor
constructor(fb: FormBuilder) {
this.heading = "Enter a different value";
this.myForm = fb.group({
"heading": [this.heading]
});
}
示例5: constructor
constructor(formBuilder: FormBuilder) {
this.form = formBuilder.group({
name: ["", Validators.required],
priority: [0]
});
this.todoList = new TodoList();
};
示例6: constructor
constructor(builder: FormBuilder) {
this.form = builder.group({
firstName : [""], //Validators.required is not present in angular2/angular2
middleName : [""],
lastName : [""],
designation: [""]
});
}
示例7: constructor
constructor(builder: FormBuilder) {
this.amountControl = new Control()
this.peopleCountForm = builder.group({
"amount": this.amountControl
});
this.ttAmountChange = new EventEmitter();
}
示例8: constructor
constructor(
public formBuilder: FormBuilder,
public todoService: TodoService) {
this.todoForm = formBuilder.group({
'todo': ['', Validators.required]
});
this.todoInput = this.todoForm.controls.todo;
}
示例9: m
set m(t: Task) {
this.task = t;
this.form = this.fb.group({
text: [t.text],
up: [t.up],
down: [t.down]
});
}