Search code examples
angularangular-materialangular-validation

How to make the mat-select validation work?


My code is resided in here.

A popup modal will be popup when the button is pressed.

My problem is the "System" drop-down box validation does not work, that mean the error message does not show when I click the "System" drop-down box , and then click somewhere in the popup modal.

I have another drop-down box validation sample which is working properly in here.

Would you tell me how to solve the problem?


Solution

  • In your CallTreeManualContactMapping.ts of your not working example you got

    export class CallTreeManualContactMapping {
      division: string;
      callTreeId = -1;
    }
    

    But in the one that is working you got

    export class CallTreeManualContactMapping {
      division: string;
      systemName: string;
      callTreeId:number;
    }
    

    Personally, when I change the file like this it works.