I need to import a library dynamically depending on the browser platform. To prevent Angular Universal from giving errors because its using the window object.
import * as Muuri from 'muuri';
So what I want is something like this:
if (isPlatformBrowser(this.platform)) {
import * as Muuri from 'muuri';
}
else {
declare var Muuri;
}
Obviously this doesn't work.