本文整理匯總了TypeScript中angular2/common.FormBuilder.group方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormBuilder.group方法的具體用法?TypeScript FormBuilder.group怎麽用?TypeScript FormBuilder.group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類angular2/common.FormBuilder
的用法示例。
在下文中一共展示了FormBuilder.group方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(public http: Http, public fb: FormBuilder){
this.myForm = fb.group({
sku: ['ABC123', Validators.required],
sku1: ['ABC1234', Validators.required]
});
console.log(this.myForm.value)
}
示例2: constructor
constructor(fb: FormBuilder, private dn: DonationService,
private params: RouteParams, private rss: ReservationService,
private router: Router) {
this.form = fb.group({
"description": ["", Validators.required]
});
this.donation = dn.getByTitle(decodeURIComponent(params.get("title")));
}
開發者ID:MuhammedHasan,項目名稱:comodo-intership-program-application-project,代碼行數:10,代碼來源:detail.component.ts
示例3: constructor
constructor(private fb: FormBuilder, private translate: TranslateService) {
this.translate = translate;
this.authForm = fb.group({
'username': ['', Validators.compose([Validators.required, Validators.minLength(8), this.checkFirstCharacterValidator])],
'password': ['', Validators.compose([Validators.required, Validators.minLength(8), this.checkFirstCharacterValidator])]
});
this.username = this.authForm.controls['username'];
this.password = this.authForm.controls['password'];
}
示例4: constructor
constructor(private router: Router) {
let fb = new FormBuilder();
this.loginForm = fb.group({
email: ['',Validators.required],
password: ['',Validators.required]
});
this.error = '';
}
示例5: constructor
constructor(fb: FormBuilder) {
this.form = fb.group({
// three args: default, validators, async validators.
username: ['', Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace,
]), UsernameValidators.shouldBeUnique],
password: ['', Validators.required]
});
}
示例6: constructor
constructor(fb: FormBuilder, public addressService: Addresses, private router: Router) {
this.addressForm = fb.group({
'mail': ['', Validators.compose([
Validators.required, mailValidator])],
'firstName': ['', Validators.required],
'lastName': ['', Validators.required],
'country': ['', Validators.required]
});
}
示例7: constructor
constructor(private fb: FormBuilder) {
this.email = new Control();
this.aboutUsForm = fb.group({
email: this.email
});
this.email.valueChanges
.subscribe(value => this.data = value);
}
示例8: constructor
constructor(fb: FormBuilder) {
this.skuForm = fb.group({
'sku': ['', Validators.compose([
Validators.required, skuValidator
])]
})
this.sku = this.skuForm.controls['sku'];
}
示例9: constructor
constructor(formBuilder: FormBuilder, public nav: NavController, public events: Events, public http: HttpService, public menu: MenuController) {
this.nav = nav;
this.events = events;
this.http = http;
// Build login form with validators
this.loginForm = formBuilder.group({
username: ["", Validators.compose([Validators.required, ValidationService.emailValidator])],
password: ["", Validators.required]
});
}
示例10: constructor
constructor(fb: FormBuilder, private login: LoginService){
this.form= fb.group({
username:['',Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace
]),Validators.composeAsync([
UsernameValidators.shouldBeUnique,
UsernameValidators.shouldNotBeEmpty])],
password: ['',Validators.required]
});
}