File

src/ngx-form-errors/src/models.ts

Properties

errorKey
errorKey:

Bind the template to a specific error key. When not set the context is considered the global (default) template for the scope.

maxError
maxError: number
Type : number

Maximum number of errors to display

order
order: []
Type : []

A list of error keys that defines the order of which errors appear.

The list can be partial, following errors will display in the order they were added.

renderIf
renderIf:

A predicate that allows filtering out error message right before they are displayed.

Function (and arrow functions) are not allowed in angular template expressions so the predicate should be defined on a component.

import { Component } from '@angular/core';
import { AbstractControl } from '@angular/forms';

\ @Component({
   selector: 'showcase-home',
   templateUrl: 'showcase-home.component.html',
})
export class ShowcaseHomeComponent {

   renderIf(c: AbstractControl): boolean {
     return c.dirty;
   }
}
<div *ngxErrorTemplate="let item; renderIf: renderIf"  class="form-control-feedback">{{item.message}}</div>

results matching ""

    No results matching ""