本文整理匯總了TypeScript中@angular/forms.FormGroup類的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormGroup類的具體用法?TypeScript FormGroup怎麽用?TypeScript FormGroup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FormGroup類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should return null when path is empty', () => {
const g = new FormGroup({});
expect(g.get([])).toEqual(null);
});
示例2: isTouched
public isTouched(): boolean {
return this.formGroup.get(this.controlName).touched;
}
開發者ID:davsuapas,項目名稱:Angular2Ionic2ReusableApplications,代碼行數:3,代碼來源:edition-error-message.component.ts
示例3: hasError
public hasError(): boolean {
return this.formGroup.hasError(this.validationName, [this.controlName]);
}
開發者ID:davsuapas,項目名稱:Angular2Ionic2ReusableApplications,代碼行數:3,代碼來源:edition-error-message.component.ts
示例4: onPlusButton
/**
* Opens the create form.
*/
public onPlusButton(): void {
if (!this.projectorToCreate) {
this.projectorToCreate = new Projector();
this.createForm.setValue({ name: '' });
}
}
示例5:
const paramedic = this.paramedics.filter(paramedic => paramedic._id === this.formEmergency.get('driver').value);
示例6: dirtyDescription
/**
* @returns true if the description on the form differs from the poll's description
*/
public get dirtyDescription(): boolean {
return this.descriptionForm.get('description').value !== this.poll.description;
}
示例7: goBack
public goBack(): void {
this.passwordForm.reset();
this.location.back();
}
示例8: search
/**
* Handler for the search bar
*/
public search(): void {
const query = this.searchform.get('query').value;
this.searchform.reset();
this.router.navigate(['/search'], { queryParams: { query: query } });
}
示例9: onEditDescriptionButton
/**
* Sends the edited poll description to the server
* TODO: Better feedback
*/
public async onEditDescriptionButton(): Promise<void> {
const desc: string = this.descriptionForm.get('description').value;
await this.assignmentRepo.updatePoll({ description: desc }, this.poll).then(null, this.raiseError);
}