@angular/forms#NgModel TypeScript Examples

The following examples show how to use @angular/forms#NgModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: githubvaliddirective.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(private gitHubUrlModel: NgModel, private projectApiService: ProjectApiService) {
    this.gitHubUrlModel.control.valueChanges.subscribe((value: string) => {
      if (value === undefined || value.length === 0) {
        return;
      }
      this.projectApiService.githubUrlValid(value).subscribe(
        (response) => {
          if (response === 'error') {
            this.gitHubUrlModel.control.setErrors({ gitHubUrlDoesNotExist: true });
          } else {
            return null;
          }
        },
        (error) => {},
      );
    });
  }
Example #2
Source File: my-create-report.page.ts    From fyle-mobile-app with MIT License 5 votes vote down vote up
@ViewChild('reportTitleInput') reportTitleInput: NgModel;
Example #3
Source File: create-new-report.component.ts    From fyle-mobile-app with MIT License 5 votes vote down vote up
@ViewChild('reportTitleInput') reportTitleInput: NgModel;
Example #4
Source File: eda-input.component.ts    From EDA with GNU Affero General Public License v3.0 5 votes vote down vote up
@ViewChild('in') in: NgModel;
Example #5
Source File: eda-input.ts    From EDA with GNU Affero General Public License v3.0 5 votes vote down vote up
_model: NgModel;
Example #6
Source File: certified-model-add.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #7
Source File: revoked-model-add.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #8
Source File: model-info-edit.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #9
Source File: testing-result-add.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #10
Source File: add-certificate.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #11
Source File: propose-certificate.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }
Example #12
Source File: tx-preview.component.ts    From distributed-compliance-ledger with Apache License 2.0 5 votes vote down vote up
getValidityClasses(model: NgModel) {
    return {
      'is-valid': (model.touched || this.showValidation) && model.valid,
      'is-invalid': (model.touched || this.showValidation) && model.invalid
    };
  }