Browser code should not rely on things that are not available in browser environments. Otherwise it throws error global is undefined. see [angular-cli issue](https://github.com/angular/angular-cli/issues/9827#issuecomment-369578814)