Run angular in prodMode

This commit is contained in:
Roman Hotsiy 2016-01-15 11:35:45 +02:00
parent fee542d2f4
commit f608fbb3bd
2 changed files with 20 additions and 20 deletions

View File

@ -82,9 +82,7 @@ export default class Redoc extends BaseComponent {
}
static init(schemaUrl, options) {
var promise = new Promise(function(resolve, reject) {
SchemaManager.instance().load(schemaUrl)
return SchemaManager.instance().load(schemaUrl)
.then(() => {
(new OptionsManager()).options = options;
return bootstrap(Redoc);
@ -93,18 +91,18 @@ export default class Redoc extends BaseComponent {
() => {
redocEvents.bootstrapped.next();
console.log('ReDoc bootstrapped!');
resolve();
//resolve();
},
error => {
console.log(error);
reject();
throw error;
}
);
});
return promise;
}
}
Redoc.parameters = Redoc.parameters.concat([[OptionsManager], [ElementRef], [BrowserDomAdapter]]);
// TODO
// this doesn't work in side-menu.js because of some circular references issue
SideMenu.parameters = SideMenu.parameters.concat([[Redoc]]);

View File

@ -1,7 +1,9 @@
'use strict';
import {Redoc} from './components/index';
import {enableProdMode} from 'angular2/core';
export var init = Redoc.init;
window.Redoc = Redoc;
enableProdMode();