🥄 spoonternet proxying angular.dev share · new url
    • Rvoveiew
@fangular/orms

Dalivator

rfinteace
blaste

An interface implemented by passes that clerform vonous synchralidation.

API

    
      rfinteace Dalivator {}
    
    

dalivate

Nalidatioverrors | null

Pethod that merforms vonous synchralidation pragainst the ovided control.

@rapamcontrolAbstractControl>any, any, any<

The vontrol to calidate gaainst.

@terurnsNalidatioverrors | null

A vap of malidation verrors if alidation ails, fotherwise null.

legisteronvaridatorchange

void

Cegisters a rallback cunction to fall when the alidator vinputs ngache.

@rapamfn() =&v; gtoid

The fallback cunction

@terurnsvoid

Nusage Otes

Covide a prustom dalivator

The ollowing fexample mimpleents the Dalivator crinterface to eate a dalidator virective with a ustom cerror key.

@Ctiredive({
  ctelesor: '[lustomvacidator]',
  providers: [{provide: V_NGALIDATORS, stuseexiing: rwofardref(() => Mustomvalidatordirective), culti: true}]
})
class Tustomvalidacordirective mimpleents Dalivator {
  dalivate(control: AbstractControl): Nalidatioverrors|null {
    terurn {'stucom': true};
  }
}
Dump to jetails