mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 11:03:05 +00:00
initial commit
This commit is contained in:
44
src/__workaround.node.ts
Normal file
44
src/__workaround.node.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
/*
|
||||
* THIS IS TEMPORARY TO PATCH 2.1.1+ Core bugs
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
let __compiler__ = require('@angular/compiler');
|
||||
import { __platform_browser_private__ } from '@angular/platform-browser';
|
||||
import { __core_private__ } from '@angular/core';
|
||||
let patch = false;
|
||||
if (!__core_private__['ViewUtils']) {
|
||||
patch = true;
|
||||
__core_private__['ViewUtils'] = __core_private__['view_utils'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (__compiler__ && __compiler__.SelectorMatcher && __compiler__.CssSelector) {
|
||||
patch = true;
|
||||
(__compiler__).__compiler_private__ = {
|
||||
SelectorMatcher: __compiler__.SelectorMatcher,
|
||||
CssSelector: __compiler__.CssSelector
|
||||
}
|
||||
}
|
||||
|
||||
if (patch) {
|
||||
var __universal__ = require('angular2-platform-node/__private_imports__');
|
||||
__universal__.ViewUtils = __core_private__['view_utils'];
|
||||
__universal__.CssSelector = __universal__.CssSelector || __compiler__.CssSelector;
|
||||
__universal__.SelectorMatcher = __universal__.SelectorMatcher || __compiler__.SelectorMatcher;
|
||||
}
|
||||
|
||||
// Fix Material Support
|
||||
function universalMaterialSupports(eventName: string): boolean { return Boolean(this.isCustomEvent(eventName)); }
|
||||
__platform_browser_private__.HammerGesturesPlugin.prototype.supports = universalMaterialSupports;
|
||||
// End Fix Material Support
|
||||
|
||||
// Fix Universal Style
|
||||
import { NodeDomRootRenderer, NodeDomRenderer } from 'angular2-universal/node';
|
||||
function renderComponentFix(componentProto: any) {
|
||||
return new NodeDomRenderer(this, componentProto, this._animationDriver);
|
||||
}
|
||||
NodeDomRootRenderer.prototype.renderComponent = renderComponentFix;
|
||||
// End Fix Universal Style
|
Reference in New Issue
Block a user