Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 07:35
    Andrei-Bahushevich edited #476
  • 00:09
    Andrei-Bahushevich opened #476
  • Mar 01 16:14
    lkachun9129 commented #460
  • Feb 25 08:30
    Kiran-Pawar edited #475
  • Feb 25 08:29
    Kiran-Pawar edited #475
  • Feb 25 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
freshdev1
@freshdev1
I looked at the guide on the website and removed all of this and changed it to:
TranslateModule.forRoot({
      globalFilePath: './assets/i18n/{{language-code}}.json',
now this used to work fine on local, but wouldn't work when deployed on my server.

then I loaded TranslateHttpLoader from @rxweb module and rewrote the above export function as:

export function HttpLoaderFactory(http: HttpClient) {
  return  new  TranslateHttpLoader(http);
}

It still failed. Since the application was hosted in a virtual directory:
ip-address/ATLP/abc/web

freshdev1
@freshdev1
Then I reimported the TranslateHttpLoader from ngx-translate this time passing it to TranslateModule of @rxweb extension. And everything started to work as expected.
import { TranslateModule, TranslateLoader } from "@rxweb/ngx-translate-extension";
import { TranslateHttpLoader } from "@ngx-translate/http-loader";

export function HttpLoaderFactory(http: HttpClient) {
  return  new  TranslateHttpLoader(http, './assets/i18n/', '.json');
}

   TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    }),
Can anyone tell me why this is an issue? I do not happen to understand the cause.
this is the final code i am having.
Ajay Ojha
@ajayojha
@freshdev1 I need to reproduce this in my local, then after will let you know. Overall it's doing the same thing without creating the custom loaderfactory.
Kiran-Pawar
@Kiran-Pawar
Hello @ajayojha can you please update me on this ticket - rxweb/rxweb#451
radixdt2020
@radixdt2020
Hi @ajayojha
I am referring to this command to add domain controller : rxwebcore --controller domain --main master --uow Master , but i am facing issue to add manually models , import files , add a interface for domain etc. Also when i am adding view model using command in Models , it's give me error of KeyLessEntity name space error which is already given name space for RxWeb.Core.Data.Annotations.
Ushmidave
@Ushmidave
@radixdt2020 which CLI version are you using ?
radixdt2020
@radixdt2020
CLI version is 9.1.7
radixdt2020
@radixdt2020
Do you asking me angular cli version or rxwebcore?
Ushmidave
@Ushmidave
rxwebcore cli
radixdt2020
@radixdt2020
How to check rxwebcore cli version?
Ushmidave
@Ushmidave
@radixdt2020 check this path there will be the installed package version number C:\Users\<username>.dotnet\tools.store\rxwebcore
radixdt2020
@radixdt2020
Package version is 1.2.2
Ushmidave
@Ushmidave
@radixdt2020 kindly install the version 1.1.6 and check the same
Nikunj V Kalathiya
@kalathiyan
is there any way to pass multiple values in start with Validator ?
like i need to validate string start with AA OR BB then how to do that ?
TutoDS
@tutods_twitter
Hi guys
image.png
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
@tutods_twitter
Anyone?
freshdev1
@freshdev1
@tutods_twitter I think last supported version is Angular 10 for RxWebValidators. Ajay will confirm.
freshdev1
@freshdev1

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 {
    @propObject(TenantContractGeneralInformation)
    BasicInformation: TenantContractGeneralInformation = new TenantContractGeneralInformation();

    @propObject(TenantContractDetails)
    TenantContractDetails: TenantContractDetails = new TenantContractDetails();

    @propObject(DocumentSubmission)
    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()
    );
    console.log(this.contractForm);
  }
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
@ajayojha
@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.
Ushmidave
@Ushmidave
@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 ?
freshdev1
@freshdev1
@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.
radixdt2020
@radixdt2020
@Ushmidave Still not face any issue in rxwebcore version 1.1.6.
Ushmidave
@Ushmidave
@radixdt2020 What issue are you facing now ?
freshdev1
@freshdev1
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.
freshdev1
@freshdev1

@ajayojha This do not work:

export class TenantContractGeneralInformation {

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

    @disable({conditionalExpression:function(control:AbstractControl){return true; }})
    @prop()
    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.

freshdev1
@freshdev1

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"
              formControlName="ContractStartDate" 

              />
            <div class="input-group-prepend">
              <button class="btn" (click)="dpContractStartDate.toggle()" type="button">
                <i class="far fa-calendar-alt"></i>
              </button>
            </div>
          </div>
          <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>
        </div>
      </div>

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

freshdev1
@freshdev1
@ajayojha dude can you tell me what mistake I am doing above.
MINDATE error is not removing
Nikunj V Kalathiya
@kalathiyan
image.png
HI RxTeam,
in above image SelectedJournal is object, is there any any way to bind that object instead of journalId in rx-select ?
freshdev1
@freshdev1
Group anybody who has faced the min error I mentioned above.
Any help would be appreciated. I don't understand where I am wrong.
freshdev1
@freshdev1
Anybody happen to use it with Template driven form?