Aurelia validation - notation (res :Class) =>

i follow manual :
and in section multiple validation controllers is used notation:
(res: ItalianRestaurant) =>

const pizzaRules = ValidationRules
.ensure((res: ItalianRestaurant) =>

in my new fresh app (Es2015, babel, cli, webpack )
i cant use this notation . I 've got error:

Module build failed: SyntaxError: Unexpected token, expected ,

generally speaking where is a problem ? :slight_smile:

btw. when i use direct property validation like this:

validation “work” and i got error but when field is not empty i still got error ?
it’s weired

if you are using babel as transpiler, it means you are writing code in ESNext not in TypeScript, so res: ItalianRestaurant should not be a valid syntax since JS do not allow us to explicitly tell the data type.


const pizzaRules = ValidationRules
.ensure(res =>

@lyrog please ensure you have dependencies updated
there is currently an investigation of issue with npm updating the dependencies

latest aurelia-validation requires aurelia-binding: ^1.7.1

seems like npm ugrade does not do the right job

You are right. There is mistake in mentioned documentation.

It was long fight :slight_smile: but at least i find out, if I need to validate property of nested class i nedd to use special syntax :
i nedd to use validation like that