aurelia-validation

Load aurelia-validation plugin during Jasmine unit tests - with webpack

喜欢而已 提交于 2019-12-11 03:28:22
问题 I am using Aurelia with Webpack. Based on the ESNext Skeleton Webpack. https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-esnext-webpack I have some plain JS model classes like: import {ValidationRules} from 'aurelia-validation'; export class Address { street = ''; } ValidationRules .ensure('street').required() .on(Address); As soon as I run my Jasmine tests (via Karma) and also with Wallaby, I get the error: 'Message: Did you forget to add ".plugin('aurelia-validation)" to

How to load an Aurelia plugin in Karma

南笙酒味 提交于 2019-12-10 17:04:07
问题 I've this ViewModel which is a login confirmation page viewmodel: src/pages/confirm.ts import { autoinject } from 'aurelia-framework'; import { Router, NavigationInstruction } from 'aurelia-router'; import { ValidationControllerFactory, ValidationController, ValidationRules } from 'aurelia-validation'; import { LoginService } from '../services/login.service'; import { Settings } from '../config/settings'; import { State } from '../services/state'; import { Helpers } from '../services/helpers'

Aurelia Validation - no message shown on failed validation

雨燕双飞 提交于 2019-12-07 13:51:29
问题 I've been working through the Aurelia-Validation example, and I have the following: index.html <!doctype html> <html> <head> <title>Aurelia</title> <link rel="stylesheet"href="styles/styles.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body aurelia-app="main"> <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> System.import('aurelia-bootstrapper'); </script> </body> </html> welcome.js import {Validation} from

Aurelia: Trigger Validation on tab-out(blur event)

爷,独闯天下 提交于 2019-12-07 12:43:43
问题 I have returned a validation group to validate my inputs which triggers on submit button and I want to trigger by validation on blur event to trigger respective validation, not all. For example: HTML: <form role="form" submit.delegate="welcome()" validate.bind="validation"> <div class="form-group"> <label for="fn">First Name</label> <input type="text" value.bind="firstName & updateTrigger:'blur'" class="form-control" id="fn" placeholder="first name" /> <span>${firstName}</span> </div> <button

Aurelia Validation not working with object properties

拈花ヽ惹草 提交于 2019-12-06 06:37:10
问题 I can't get Aurelia-Validate to work on the fields in my calendar record. calendar.html (excerpt) <form> <div class="form-group"> <label class="control-label" for="cal_name_orig">Calendar name</label> <input type="text" class="form-control" id="cal_name_orig" value.bind="calendar.cal_name_orig & validate"> </div> <div class="form-group"> <label class="control-label" for="cal_name_tran">Translated name</label> <input type="text" class="form-control" id="cal_name_tran" value.bind="calendar.cal

Aurelia Validation - no message shown on failed validation

拥有回忆 提交于 2019-12-06 04:00:29
I've been working through the Aurelia-Validation example, and I have the following: index.html <!doctype html> <html> <head> <title>Aurelia</title> <link rel="stylesheet"href="styles/styles.css"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body aurelia-app="main"> <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> System.import('aurelia-bootstrapper'); </script> </body> </html> welcome.js import {Validation} from 'aurelia-validation'; export class Welcome{ static inject() { return [Validation]; } constructor(validation)

Aurelia: Trigger Validation on tab-out(blur event)

拟墨画扇 提交于 2019-12-06 02:53:30
I have returned a validation group to validate my inputs which triggers on submit button and I want to trigger by validation on blur event to trigger respective validation, not all. For example: HTML: <form role="form" submit.delegate="welcome()" validate.bind="validation"> <div class="form-group"> <label for="fn">First Name</label> <input type="text" value.bind="firstName & updateTrigger:'blur'" class="form-control" id="fn" placeholder="first name" /> <span>${firstName}</span> </div> <button type="submit" class="btn btn-default">Submit</button> </form> Validation Rule in ViewModel : this

Aurelia Validation not working with object properties

主宰稳场 提交于 2019-12-04 14:50:10
I can't get Aurelia-Validate to work on the fields in my calendar record. calendar.html (excerpt) <form> <div class="form-group"> <label class="control-label" for="cal_name_orig">Calendar name</label> <input type="text" class="form-control" id="cal_name_orig" value.bind="calendar.cal_name_orig & validate"> </div> <div class="form-group"> <label class="control-label" for="cal_name_tran">Translated name</label> <input type="text" class="form-control" id="cal_name_tran" value.bind="calendar.cal_name_tran & validate"> </div> </form> calendars.js (simplified): import { inject, NewInstance } from