aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

Chaining binding behavior seems to break validations #72

Closed tt0mmy closed 8 years ago

tt0mmy commented 8 years ago

Chaining binding behavior like this:

<input type="text" value.bind="model.name & validate & updateTrigger:'blur'" input.delegate="validator.validate()"/>

seems to break validations. Gist created below. https://gist.run/?id=0d002878bb063bfd72400a05669af99f

Below also doesn't work:

//viewModel
export class ViewModel {
    this.person = new PersonModel();
    subscriber;
    constructor() {
        this.reporter = ValidationEngine.getValidationReporter(this.person);
        this.subscriber = this.reporter.subscribe(result=> {
            console.log(result);
        })
    }
}
export class PersonModel {
    @length({minimum: 5, maximum: 10}) name = '';
}

//template
<form>
    <div class="form-group">
        <label for="title">Name</label>
        <input type="text" value.bind="person.name & updateTrigger:'change' & validate"/>
    </div>
</form>
ma3yta commented 8 years ago

When it will be fixed? Anybody works on it?

EisenbergEffect commented 8 years ago

I'm going to close this issues because we have a big update coming to validation that includes update trigger support.

AlbertoMonteiro commented 8 years ago

@EisenbergEffect is this solved?