本文整理汇总了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);
}