How to use the @angular/platform-server/src/parse5_adapter.Parse5DomAdapter.makeCurrent function in @angular/platform-server

To help you get started, we’ve selected a few @angular/platform-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / universal / modules / universal / src / node / platform / node.ts View on Github external
import {NodeDomRootRenderer_} from './dom/node_dom_renderer';
import {NodeXHRImpl} from './node_xhr_impl';
import {NodeSharedStylesHost} from './node_shared_styles_host';
import {NodeTemplateParser} from './node_template_parser';
import {NodeTemplateParserRc0} from './node_template_parser-rc.0';
import {NODE_PLATFORM_DIRECTIVES} from '../directives';

// should be Private
import {WebAnimationsDriver} from '@angular/platform-browser/src/dom/web_animations_driver';
import {reflector} from '@angular/core/src/reflection/reflection';
import {AnimationDriver, NoOpAnimationDriver} from '@angular/core/src/animation/animation_driver';
var CONST_EXPR = v => v;
import {Parse5DomAdapter} from '@angular/platform-server/src/parse5_adapter';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {isPresent} from '../../common';
Parse5DomAdapter.makeCurrent(); // ensure Parse5DomAdapter is used
var DOM: any = getDOM();
var isRc0 = require('@angular/core/package.json').version.indexOf('-rc.0') !== -1;


export function initNodeAdapter() {
  Parse5DomAdapter.makeCurrent();
}

export const NODE_APP_PLATFORM_MARKER = new OpaqueToken('NodeAppPlatformMarker');

export const NODE_APP_PLATFORM: Array = CONST_EXPR([
  ...PLATFORM_COMMON_PROVIDERS,
  new Provider(NODE_APP_PLATFORM_MARKER, {useValue: true}),
  new Provider(PLATFORM_INITIALIZER, {useValue: initNodeAdapter, multi: true}),
]);
github angular / universal / modules / universal / src / node / platform / node.ts View on Github external
export function initNodeAdapter() {
  Parse5DomAdapter.makeCurrent();
}