Angular services for validating JSON. Uses tv4 under the hood, so is only able to work with JSON Schema v4.
- Includes an HTTP Interceptor service that can validate request and response data
- Recursively loads
$refschemas (ie, schemas that are referenced inside other schemas) - Supports precompilation of schemas into an Angular cache to avoid HTTP calls
-
Install with bower:
bower install angular-json-validatorOr manually download
angular-json-validator.jsandtv4.jsortv4.min.js. -
Include the JS files in your project.
angular-json-validator.jsshould be loaded afterangular.js. -
If you want to use the HTTP Interceptor, add
bt.jsonValidatoras a dependency of your application module. For example:angular.module('myApp', ['bt.jsonValidator', ...]) { ... });If you just want to use the
JsonValidatorservice, includebt.jsonValidatoras a dependency of whatever module is using it. For example:angular.module('myModule', ['bt.jsonValidator', ...]) { ... });