Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
The BETTER zone.js hack. Pretending we're node.js.
  • Loading branch information
hdeshev committed Feb 25, 2016
commit 9bcde4d0aef2022f71b40746bf65f603b98a1a95
13 changes: 8 additions & 5 deletions src/nativescript-angular/application.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
//Import globals before the zone, so the latter can patch the global functions
import 'globals';

//prevent a crash in zone patches
global.HTMLElement = function() {}
global.document = {};
//prevent a crash in zone patches. pretend we're node.js
global.process = {};
const oldToString = Object.prototype.toString;
Object.prototype.toString = function() {
return "[object process]";
}
import "zone.js/dist/zone.js"
global.HTMLElement = undefined;
global.document = undefined;
Object.prototype.toString = oldToString;
delete global.process;

import 'reflect-metadata';
import './polyfills/array';
Expand Down