ng2-validation
ng2-validation copied to clipboard
Not working in angular2 application
My app doesn't works. The follow error occurs when i include ng2-validation:
(SystemJS) Unexpected token <
SyntaxError: Unexpected token <
at eval (
My system.js is:
System.config({
paths: {
'npm:': './node_modules/'
},
map: {
'ng2-validation' : 'npm:ng2-validation/bundles/ng2-validation.umd.js'
},
packages: {
'ng2-validation' : {main: 'index' , defaultExtension: 'js'}
}
});
i tryed this variations too:
System.config({
paths: {
'npm:': './node_modules/'
},
map: {
'ng2-validation' : 'npm:ng2-validation/bundles/ng2-validation.umd.js'
}
});
System.config({
paths: {
'npm:': './node_modules/'
},
map: {
'ng2-validation' : 'npm:ng2-validation/dist/index.js',
'ng2-validation/dist/*' : 'npm:ng2-validation/dist/*'
},
packages: {
'ng2-validation' : {main: 'index' , defaultExtension: 'js'},
'ng2-validation/dist/' : {main: 'index' , defaultExtension: 'js'}
}
});
Has something wrong in my code or its a bug?
i fix this adding libphonenumber in my project. But i think this is some kind of bug.. because i don't want add it in project. my final system config is:
System.config({
paths: {
'npm:': './node_modules/'
},
map: {
'ng2-validation' : 'npm:ng2-validation/bundles/ng2-validation.umd.js',
'libphonenumber-js' : 'npm:libphonenumber-js/bundle/libphonenumber-js.min.js'
},
packages: {
'ng2-validation' : {defaultExtension: 'js'},
'libphonenumber-js' : {defaultExtension: 'js'}
}
});
I cant figure this out either. I'm stuck on 3.9.1 because updating gives this same error. I did an npm install for libphonenumber-js but am still getting the error if i dont add it in my project like @tigredonorte . Not sure what the issue is here.
@tigredonorte update: FWIW, i just tried removing it from "packages" in the system config and only added it under "map" and it seems to work...