I am trying to incorporate the JSON Schema validator ajv into a Polymer 2.0 component. It can be loaded with npm
npm install ajv
I am having a problem instantiating ajv within a Polymer 2.0 component.
Accessing ajv is done through the require:
var Ajv = require('ajv');
var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
var validate = ajv.compile(schema);
How do I incorporate ajv within my Polymer 2.0 element?