##angular-swagger
This module provides a simple, minimal interface for reading Swagger 2 documentation. Check out the demo page to see what we mean.
The interface is built using ordinary Bootstrap components, so you should find it very easy to theme and style.
This requires AngularJS. In addition, you will need:
But all of that is handled automatically if you install via bower.
-
Install with bower
bower install angular-swagger
-
Include all scripts and dependencies in your html
<link type="text/css" href="bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet"/> <link type="text/css" href="bower_components/font-awesome/css/font-awesome.css" rel="stylesheet"/> <link type="text/css" href="bower_components/angular-swagger/dist/angular-swagger.css" rel="stylesheet"/> <script type="application/javascript" src="bower_components/angular/angular.js"></script> <script type="application/javascript" src="bower_components/angular-sanitize/angular-sanitize.min.js"></script> <script type="application/javascript" src="bower_components/lodash/lodash.min.js"></script> <script type="application/javascript" src="bower_components/markdown-it/dist/markdown-it.min.js"></script> <script type="application/javascript" src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script> <script type="application/javascript" src="bower_components/angular-swagger/dist/angular-swagger.js"></script>
-
Add
ng-swagger
as a module dependency to your Angular app
Simply create the following element
<api-docs url='path/to/swagger.json' />
where path/to/swagger.json
is the location of your swagger 2 documentation (usually v2/api-docs/
)