Aurelia Validation validation error detected, but no error message -


i have super simple code i'm trying validate:

<template>     <form role="form" submit.delegate="submit()" validate.bind="validation">             <div class="form-group">                 <label>test field</label>             <input type="text" value.bind="testfield" class="form-control" validate="description" placeholder="what needs done?" />             <button type="submit">submit</button>         </div>     </form> </template> 

with following viewmodel

 define(["require", "exports", "../scripts/httpclient", "aurelia-validation", "aurelia-framework"], function(require, exports, httpclient) {     var aureliavalidation = require('aurelia-validation').validation;      var myviewmodel = (function () {         function myviewmodel(httpclient, aureliavalidation, isreadycallback) {             this.httpclient = httpclient;             var self = this;              self.setupvalidation(aureliavalidation);         }         myviewmodel.prototype.activate = function (params, querystring, routeconfig) {         };          myviewmodel.prototype.setupvalidation = function (validation) {             this.testfield = "";             this.validation = validation.on(this).ensure('testfield');              //validation             //    .on(this.servicemetadata.servicedata[0])             //    .ensure('value');             this.validation = this.validation.notempty().maxlength(3);         };          myviewmodel.prototype.submit = function () {             debugger;             if (this.validation.checkall()) {                 //do             }             return null;         };         myviewmodel.inject = [httpclient, aureliavalidation];         return myviewmodel;     })();       return myviewmodel; }); 

now got working part, , validation showing false on submit check, textbox outline color changes etc., it's not injecting validation error messages dom. there's no script error message either, how can troubleshoot this?

yes, can see validation messages in validationproperties, they're not written ui.

if browser allows it, find jspm packages in sources , put a breakpoint here, it's point view strategy looks labels append error messages to. if you'd have code in open, i'd happy have you.

also, version of aurelia/aurelia-validation using?

and finally, did modify sample before posting?

`<input value.bind="testfield" validate="description" />` 

these 2 attributes contradictory. binds value testfield, use validate attribute explicitly show validation messages property "description".


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -