0
votes
 import {Router, RouterConfiguration} from 'aurelia-router'
 import {I18N} from 'aurelia-i18n';
 import {autoinject} from 'aurelia-framework';
 import { ValidationConfig } from 'aurelia-validation';


 @autoinject
 export class App {

 router: Router;
 i18n: I18N;

 constructor(i18n: I18N,validationConfig:ValidationConfig) {
    this.i18n = i18n;
 }

does not work. I get a :

aurelia-pal.js:38 Uncaught (in promise) Error: Error invoking undefined. Check > the inner error for details.

Inner Error: Message: Type is not a constructor Inner Error Stack: TypeError: Type is not a constructor at Object.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:323:14) at InvocationHandler.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:300:168) at Container.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:564:25) at StrategyResolver.get (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:127:37) at Container.get (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:501:23) at Object.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:335:57) at InvocationHandler.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:300:168) at Container.invoke (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:564:25) at StrategyResolver.get (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:127:37) at Container.get (http://localhost:9000/jspm_packages/npm/[email protected]/aurelia-dependency-injection.js:501:23)

If I remove the dependency on ValidationConfig I get no errors.

I am using I18n and want to set the validation's local when the global locale changes.

The plugin is init as follows:

.plugin('aurelia-validation', (config:ValidationConfig) => {
  config
    .useLocale('en-US')
    .useViewStrategy((<any>TWBootstrapViewStrategy).AppendToInput);        
})

I'm using: "aurelia-pal": "npm:[email protected]" "aurelia-validation": "npm:[email protected]"

1

1 Answers

0
votes

ValidationConfig has been removed and hence this error is resolved.

ValidationConfig no longer exists

The issue was raised on github by user dstroyrofworlds.