1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Angular Material 2: Fix for Multiline Error messages

Discussão em 'Angular' iniciado por Deniss M., Novembro 21, 2025.

  1. Deniss M.

    Deniss M. Guest

    I'm using angular material 2 inside my angular application. I'm experiencing a problem when my form input field error messages are more than one line. Here is the photo:

    [​IMG]

    Here is the code:

    <md-error *ngIf="password.touched && password.invalid">
    <span *ngIf="password.errors.required">
    {{'PASSWORD_RECOVERY.FIELD_REQUIRED' | translate}}
    </span>
    <span *ngIf="password.errors.minlength || password.errors.maxlength">
    {{'PASSWORD_RECOVERY.PASSWORD_LENGTH' | translate}}
    </span>
    <span *ngIf="password.errors.pattern">
    {{'PASSWORD_RECOVERY.FOR_A_SECURE_PASSWORD' | translate}}
    </span>
    </md-error>


    I've understood by reading github, that it is a bug in angular 2 material. Did anybody manage to solve this issue by doing a custom workaround?

    Continue reading...

Compartilhe esta Página