2015-10-03 15:11:57 +03:00
|
|
|
'use strict';
|
|
|
|
|
2015-12-14 18:20:40 +03:00
|
|
|
import {bootstrap} from 'angular2/platform/browser';
|
2015-11-16 02:10:04 +03:00
|
|
|
import {Redoc} from './components/index';
|
2015-10-27 20:44:08 +03:00
|
|
|
import SchemaManager from './utils/SchemaManager';
|
2015-11-27 01:43:01 +03:00
|
|
|
import {redocEvents} from './events';
|
2015-10-07 12:47:57 +03:00
|
|
|
export * from './components/index';
|
2015-10-03 11:54:09 +03:00
|
|
|
|
2015-11-27 01:43:01 +03:00
|
|
|
|
|
|
|
|
2015-10-07 12:47:57 +03:00
|
|
|
export function init(schemaUrl) {
|
2015-11-16 02:10:04 +03:00
|
|
|
SchemaManager.instance().load(schemaUrl)
|
|
|
|
.then(() => bootstrap(Redoc))
|
2015-10-15 20:06:33 +03:00
|
|
|
.then(
|
2015-11-27 01:43:01 +03:00
|
|
|
() => {
|
|
|
|
redocEvents.bootstrapped.next();
|
|
|
|
console.log('ReDoc bootstrapped!');
|
|
|
|
},
|
2015-10-03 11:54:09 +03:00
|
|
|
error => console.log(error)
|
|
|
|
);
|
|
|
|
}
|
2015-10-15 20:06:33 +03:00
|
|
|
|
|
|
|
window.Redoc = Redoc;
|