diff --git a/lib/index.ts b/lib/index.ts deleted file mode 100644 index 0600582b..00000000 --- a/lib/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; -import './components/Redoc/redoc-initial-styles.css!css'; -import 'dropkickjs/build/css/dropkick.css!css'; -import 'prismjs/themes/prism-dark.css!css'; -import 'hint.css/hint.base.css!css'; -//import { redocVersion } from './version.js'; - -import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; -import { enableProdMode } from '@angular/core'; -import { Redoc } from './components/index'; -import { optionsService } from './redoc.module.ts'; - -//Redoc.version = redocVersion; -var moduleRef; -export var init = function(specUrl:string, options) { - if (!optionsService.options.debugMode) { - enableProdMode(); - } - - if (moduleRef) { - destrot(); - } - - optionsService.options = options; - optionsService.options.specUrl = optionsService.options.specUrl || specUrl; - - Redoc.showLoadingAnimation(); - return SpecManager.instance().load(specUrl) - .then(() => { - - return platformBrowserDynamic().bootstrapModule(MyAppModule); - }) - .then(appRef => { - Redoc.hideLoadingAnimation(); - Redoc.appRef = appRef; - console.log('ReDoc bootstrapped!'); - }).catch(err => { - Redoc.hideLoadingAnimation(); - Redoc.displayError(err); - throw err; - }); -} - -export var destroy = function() { - //t -}; - - -export var autoInit = function() { - // tes -}; - -autoInit() diff --git a/lib/redoc.module.ts b/lib/redoc.module.ts deleted file mode 100644 index 7ce6ce74..00000000 --- a/lib/redoc.module.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { NgModule, provide } from '@angular/core'; -import { BrowserDomAdapter } from '@angular/platform-browser/src/browser/browser_adapter'; -import { BrowserModule } from '@angular/platform-browser'; - -import { Redoc } from './components/Redoc/redoc'; -import { OptionsService, RedocEventsService, MenuService, - ScrollService, Hash, WarningsService } from './services/index'; -import { SpecManager } from './utils/SpecManager'; - -export const optionsService = new OptionsService(new BrowserDomAdapter()); - -@NgModule({ - imports: [ BrowserModule ], - declarations: [ Redoc ], - bootstrap: [ Redoc ], - providers: [ - SpecManager, - BrowserDomAdapter, - RedocEventsService, - ScrollService, - Hash, - MenuService, - WarningsService, - provide(OptionsService, {useValue: optionsService}) - ], -}) -export class RedocModule { -}