Skip to content

Commit

Permalink
fix(platform): Remove assumption of `window' in MdPlatform (#2221)
Browse files Browse the repository at this point in the history
Makes it work when loaded in node
  • Loading branch information
timvdalen authored and jelbourn committed Dec 17, 2016
1 parent a818579 commit e436775
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/core/platform/platform.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ declare const window: any;

// Whether the current platform supports the V8 Break Iterator. The V8 check
// is necessary to detect all Blink based browsers.
const hasV8BreakIterator = (window.Intl && (window.Intl as any).v8BreakIterator);
const hasV8BreakIterator = typeof(window) !== 'undefined' ?
(window.Intl && (window.Intl as any).v8BreakIterator) :
(typeof(Intl) !== 'undefined' && (Intl as any).v8BreakIterator);

/**
* Service to detect the current platform by comparing the userAgent strings and
Expand Down

0 comments on commit e436775

Please sign in to comment.