Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
How do I use ajv in Dojo? #234
I would like to use ajv in my Dojo web application, but cannot figure out how to include the ajv module and use it - when i tried to include it from the source code, it complains it could not find compile module
first I tried including this in my index.html
I also tried downloading the source code and in my dojo config I included the path to ajv in my packages like this
and then in my script I require it like this
But it just error out.
Any ideas how to do this?
Have you tried using the bundle from cdnjs? https://github.com/epoberezkin/ajv#using-in-browser
I did try that as well, but the code did not work. The new Ajv object that is created in that code example is not recognized. (seems the script tag I tried adding got interpreted as a script, not as a code snippet - sort of fixed it int he original comment)
What happens is it throws error on this line
Regardless I cannot use the cdnjs anyway because my program is required to run offline (no internet access)
In Dojo the require might be something like this
I think you are right, I got it to work by loading the ajv bundle before I load dojo.js. My index.html looks like this.