Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ngAfterViewInit() {
if (isPlatformBrowser(this.platformId)) {
this.initFullpage();
}
if (isPlatformServer(this.platformId)) {
// server side code
}
}
constructor(serverModuleLoaded, platformId) {
if (isPlatformServer(platformId) && !serverModuleLoaded) {
console.warn('Warning: Flex Layout loaded on the server without FlexLayoutServerModule');
}
}
/**
initGoogleAnalytics() {
if (isPlatformServer(this.platformId)) {
return;
}
try {
window["ga"] =
window["ga"] ||
function() {
(ga.q = ga.q || []).push(arguments);
};
ga.l = +new Date();
ga("create", this.googleAnalyticsKey, "auto");
} catch (e) {
console.log(e);
}
}
startCheckTokenHasExpired() {
if (!isPlatformServer(this._platformId)) {
this._checkTokenHasExpiredIntervalRef = setInterval(_ => {
if (this.checkTokenHasExpired()) {
this.tokenHasExpired = true;
}
}, 30 * 1000);
}
}
getTokenData(token: string): { payload: { exp: number } } {
public isServerApplication(): boolean {
return isPlatformServer(this._platformId);
}
}
setStatus(status: number) {
if (isPlatformServer(this.platformId)) {
this.response.status(status);
}
}
function DomEventsPlugin(doc, ngZone, platformId) {
var _this = _super.call(this, doc) || this;
_this.ngZone = ngZone;
if (!platformId || !isPlatformServer(platformId)) {
_this.patchEvent();
}
return _this;
}
DomEventsPlugin.prototype.patchEvent = function () {
protected transfer(externalConfig: OccLoadedConfig) {
if (
this.transferState &&
isPlatformServer(this.platform) &&
externalConfig
) {
this.transferState.set(EXTERNAL_CONFIG_TRANSFER_ID, externalConfig);
}
}
setProfile(profile: Profile): void {
if (isPlatformServer(this.platformId)) {
return;
}
if (profile.dataSets == null) {
profile.dataSets = [];
}
localStorage.removeItem('profile');
localStorage.setItem('profile', JSON.stringify(profile));
};
constructor(dataSetService: DataSetService,
private router: Router,
private http: HttpClient,
@Inject(PLATFORM_ID) private platformId: string) {
super();
this.isServer = isPlatformServer(this.platformId);
this.webServiceUrl = dataSetService.getWebServiceUrl();
this.proteomicsList = dataSetService.getProteomicsList();
this.metabolomicsList = dataSetService.getMetabolomicsList();
this.genomicsList = dataSetService.getGenomicsList();
this.transcriptomicsList = dataSetService.getTranscriptomicsList();
}