redoc/lib/index.js
2015-11-27 00:43:01 +02:00

24 lines
511 B
JavaScript

'use strict';
import {bootstrap} from 'angular2/angular2';
import {Redoc} from './components/index';
import SchemaManager from './utils/SchemaManager';
import {redocEvents} from './events';
export * from './components/index';
export function init(schemaUrl) {
SchemaManager.instance().load(schemaUrl)
.then(() => bootstrap(Redoc))
.then(
() => {
redocEvents.bootstrapped.next();
console.log('ReDoc bootstrapped!');
},
error => console.log(error)
);
}
window.Redoc = Redoc;