2017-05-26 23:51:48 -04:00
|
|
|
import { enableProdMode } from "@angular/core";
|
|
|
|
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
|
|
|
|
import { AppModule } from "./app/app.module";
|
|
|
|
//noinspection TypeScriptCheckImport
|
|
|
|
|
|
|
|
// depending on the env mode, enable prod mode or add debugging modules
|
|
|
|
//noinspection TypeScriptUnresolvedVariable
|
|
|
|
if (process.env.ENV === 'build') {
|
|
|
|
enableProdMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
export function main() {
|
|
|
|
return platformBrowserDynamic().bootstrapModule(AppModule);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (document.readyState === 'complete') {
|
|
|
|
main();
|
|
|
|
} else {
|
|
|
|
document.addEventListener('DOMContentLoaded', main);
|
|
|
|
}
|
|
|
|
|
2017-05-27 19:45:07 -04:00
|
|
|
(<any>String.prototype).hashCode = function () {
|
2017-05-26 23:51:48 -04:00
|
|
|
let hash = 0, i, chr;
|
|
|
|
if (this.length === 0) return hash;
|
|
|
|
for (i = 0; i < this.length; i++) {
|
2017-05-27 19:45:07 -04:00
|
|
|
chr = this.charCodeAt(i);
|
|
|
|
hash = ((hash << 5) - hash) + chr;
|
2017-05-26 23:51:48 -04:00
|
|
|
hash |= 0; // Convert to 32bit integer
|
|
|
|
}
|
|
|
|
return hash;
|
|
|
|
};
|
2017-05-27 19:45:07 -04:00
|
|
|
|
|
|
|
// HACK: Work around .opener not being available
|
|
|
|
if (!window.opener && window.parent) window.opener = window.parent;
|