Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • 08:30
    Kiran-Pawar edited #475
  • 08:29
    Kiran-Pawar edited #475
  • 08:29
    Kiran-Pawar opened #475
  • Feb 24 17:36
    kelvinsleonardo edited #474
  • Feb 24 16:20
    kelvinsleonardo opened #474
  • Feb 19 06:43
    lkachun9129 opened #473
  • Feb 17 17:15
    ajayojha commented #471
  • Feb 17 17:13
    kelvinsleonardo commented #471
  • Feb 12 11:01
    DuncanFaulkner opened #472
  • Feb 10 22:23
    kelvinsleonardo edited #471
  • Feb 10 22:21
    kelvinsleonardo opened #471
  • Feb 08 19:41
    zavadmar commented #460
  • Feb 08 10:22
    DuncanFaulkner commented #465
  • Feb 07 16:28
    mligtenberg commented #470
  • Feb 07 16:27
    mligtenberg opened #470
  • Feb 05 09:24
    afzalmansuri opened #469
  • Feb 04 09:44
    Ushmidave opened #468
  • Feb 04 08:24
    ajayojha closed #460
  • Feb 04 08:24
    ajayojha commented #460
  • Feb 02 11:52
    DuncanFaulkner closed #467
I have this error when I try using Rxwebvalidators on my angular project
anyone can help me?
already try reinstall node_modules, but no success
I'm using Angular CLI: 11.0.5
@tutods_twitter I think last supported version is Angular 10 for RxWebValidators. Ajay will confirm.

guys I am trying to implement RxWebValidators.... Following is my model class I'm using:

import { propObject, required } from '@rxweb/reactive-form-validators';
import { DocumentSubmission } from './document-submission.model';
import { TenantContractDetails } from './tenant-contract-details.model';
import { TenantContractGeneralInformation } from './tenant-contract-general-information.model';

export class TenantContract {
    BasicInformation: TenantContractGeneralInformation = new TenantContractGeneralInformation();

    TenantContractDetails: TenantContractDetails = new TenantContractDetails();

    TenantContractDocuments: DocumentSubmission = new DocumentSubmission();

FormGroups are created in the following way:

  createFormGroup(): void {
    this.contractForm = this.formBuilder.group(
      // {
      //   BasicInformation: this.formBuilder.formGroup(new TenantContractGeneralInformation()),
      //   TenantContractDetails: this.formBuilder.formGroup(new TenantContractDetails()),
      //   TenantContractDocuments: this.formBuilder.formGroup(new DocumentSubmission())
      // }
      new TenantContract()
If I create formgroups this way none of the required or other errors are fired. If I create it the way which is commented out, all errors works as expected
Any ideas as to why this is happening.
In the above case all the formgroups have VALID Status. Do not understand as to why this is happening.
Ajay Ojha
@freshdev1 As I can see that you are creating a FormGroup through model then it's preferable to use 'formGroup' method instead of 'group' method.
@tutods_twitter there is one alternative to make this work as I provided a solution in the past to someone, but I forgot what was that, will update soon.
@kalathiyan will update you soon.
@kalathiyan passing or string value is not possible using startsWith validator you can create a feature request for the same
@radixdt2020 any update on your issue ?
@ajayojha thanks for the response, it worked. I did remember I used formGroup first but it was not working. But this works now. Thanks a lot sir.
@Ushmidave Still not face any issue in rxwebcore version 1.1.6.
@radixdt2020 What issue are you facing now ?
Hello everyone. Any idea if I can disable the whole formGroup based on a condition through model decorator?
I tried to apply disable using the @model decorator but it doesn't work.
disable is not a supported I believe.

@ajayojha This do not work:

export class TenantContractGeneralInformation {

    @disable({conditionalExpression:function(control:AbstractControl){return true; }})
    ContractNumber: string = '';

    @disable({conditionalExpression:function(control:AbstractControl){return true; }})
    ExternalContractNumber: string = '';

    AccountGUID: string = '';

    @required({ message: "FIELD_REQUIRED" })
    WorkerCity: string = '';

Any intended reason behind this? How do we mark fields as disabled if we want to without a second property.


Guys this is my model

 @required({ message: "FIELD_REQUIRED" })
    @date({ message: "INVALID_DATE", allowISODate: true })
    @minDate({ value: new Date().toDateString(), message: "INVALID_DATE", allowISODate: true, fieldName:'ContractStartDate', operator: ">"  })
    ContractExpiryDate: Date;

and template:

<div class="col-4">
        <div class="form-group">
          <label for="ContractStartDate"
            class="control-label">{{ "TENANT_CONTRACT.GENERAL_INFORMATION.CONTRACT_START_DATE" | translate }}</label>
          <div class="form-group mycustom">
            <input type="text" autocomplete="none" class="form-control" placeholder='{{"SELECT_DATE" | translate}}'
              name="ContractStartDate" ngbDatepicker #dpContractStartDate="ngbDatepicker"

            <div class="input-group-prepend">
              <button class="btn" (click)="dpContractStartDate.toggle()" type="button">
                <i class="far fa-calendar-alt"></i>
          <small class="text-danger" *ngIf="generalInformationGroup.controls.ContractStartDate.errors">
            {{ generalInformationGroup.controls.ContractStartDate.errorMessage || 
              generalInformationGroup.controls.ContractStartDate.errors.date.message || 
              generalInformationGroup.controls.ContractStartDate.errors.mindate.message | translate }}</small>

I keep getting the invalid date error. can't apply min date validation

@ajayojha dude can you tell me what mistake I am doing above.
MINDATE error is not removing
Nikunj V Kalathiya
HI RxTeam,
in above image SelectedJournal is object, is there any any way to bind that object instead of journalId in rx-select ?
Group anybody who has faced the min error I mentioned above.
Any help would be appreciated. I don't understand where I am wrong.
Anybody happen to use it with Template driven form?
I am finding it extremely hard to get it to work
it gives the following error:
Can't bind to 'rxwebform' since it isn't a known property of 'form'
Can anyone suggest what error I am making.
fixed it. F has to be capital...
now added a numeric validation. but it is not working
I think I will have to dump this product..... There is no support from the community around it.
I have been struggling so much but haven't got any response on anything to this date
@freshdev1 template driven validation is applied along with the prefix rx, incase of numeric validation using [rxnumeric], Please refer to this example
@Ushmidave thank you sir. But I do not see this in the documentation. I tried everything to get it to work.
but it works now in your example thank you. I will incorporate and comeback in case still it is not working.
@freshdev1 the documentation of template driven numeric validation is present here
Thank you for the guidance.
hello , please how to validate that user must check at less one checkbox using decorator based validation approach with rxweb
thank you