import { Container } from 'aurelia-dependency-injection' ; import { GlobalValidationConfiguration } from './config' ; import { ValidationController } from './validation-controller' ; import { Validator } from './validator' ; import { PropertyAccessorParser } from './property-accessor-parser' ; /**
 * Creates ValidationController instances.
 */ export class ValidationControllerFactory { public static get ( container ) { return new ValidationControllerFactory ( container ) ; } constructor ( private container ) { } /**
     * Creates a new controller instance.
     */ public create ( validator ? ) { if ( ! validator ) { validator = this . container . get ( Validator ) as Validator ; } const propertyParser = this . container . get ( PropertyAccessorParser ) as PropertyAccessorParser ; const config = this . container . get ( GlobalValidationConfiguration ) as GlobalValidationConfiguration ; return new ValidationController ( validator , propertyParser , config ) ; } /**
     * Creates a new controller and registers it in the current element's container so that it's
     * available to the validate binding behavior and renderers.
     */ public createForCurrentScope ( validator ? ) { const controller = this . create ( validator ) ; this . container . registerInstance ( ValidationController , controller ) ; return controller ; } } ( ValidationControllerFactory as any ) [ 'protocol:aurelia:resolver' ] = true ;