mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This reverts commit c3fafa0651.
The symbols should be configured at the component level and not be global to the compiler.
46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
import {isBlank} from '../src/facade/lang';
|
|
import {unimplemented} from '../src/facade/exceptions';
|
|
import {Identifiers} from './identifiers';
|
|
import {CompileIdentifierMetadata} from './compile_metadata';
|
|
import {ViewEncapsulation} from '@angular/core';
|
|
|
|
export class CompilerConfig {
|
|
public renderTypes: RenderTypes;
|
|
public defaultEncapsulation: ViewEncapsulation;
|
|
|
|
constructor(public genDebugInfo: boolean, public logBindingUpdate: boolean,
|
|
public useJit: boolean, renderTypes: RenderTypes = null,
|
|
defaultEncapsulation: ViewEncapsulation = null) {
|
|
if (isBlank(renderTypes)) {
|
|
renderTypes = new DefaultRenderTypes();
|
|
}
|
|
this.renderTypes = renderTypes;
|
|
if (isBlank(defaultEncapsulation)) {
|
|
defaultEncapsulation = ViewEncapsulation.Emulated;
|
|
}
|
|
this.defaultEncapsulation = defaultEncapsulation;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Types used for the renderer.
|
|
* Can be replaced to specialize the generated output to a specific renderer
|
|
* to help tree shaking.
|
|
*/
|
|
export abstract class RenderTypes {
|
|
get renderer(): CompileIdentifierMetadata { return unimplemented(); }
|
|
get renderText(): CompileIdentifierMetadata { return unimplemented(); }
|
|
get renderElement(): CompileIdentifierMetadata { return unimplemented(); }
|
|
get renderComment(): CompileIdentifierMetadata { return unimplemented(); }
|
|
get renderNode(): CompileIdentifierMetadata { return unimplemented(); }
|
|
get renderEvent(): CompileIdentifierMetadata { return unimplemented(); }
|
|
}
|
|
|
|
export class DefaultRenderTypes implements RenderTypes {
|
|
renderer = Identifiers.Renderer;
|
|
renderText = null;
|
|
renderElement = null;
|
|
renderComment = null;
|
|
renderNode = null;
|
|
renderEvent = null;
|
|
}
|