refactor(core): move outdated comment to view.ts (#44099)

remove the comment suggesting to use a const enum for ViewEncapsulation in
the renderer3/definitions.ts file and add a similar comment in the
view.ts file in which the enum is defined

Note: the new comment does not contain the suggestion of changing `None`
to `0` as it is unclear what benefits that would bring (for more info
see: https://github.com/angular/angular/pull/44099#discussion_r744157686)

PR Close #44099
This commit is contained in:
dario-piotrowicz 2021-11-06 16:57:20 +00:00 committed by Andrew Scott
parent 4809bbd83c
commit 0bd01ca64a
2 changed files with 3 additions and 2 deletions

View file

@ -19,6 +19,9 @@
* @publicApi
*/
export enum ViewEncapsulation {
// TODO: consider making `ViewEncapsulation` a `const enum` instead. See
// https://github.com/angular/angular/issues/44119 for additional information.
/**
* Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host
* Element and pre-processing the style rules provided via {@link Component#styles styles} or

View file

@ -315,8 +315,6 @@ export function ɵɵdefineComponent<T>(componentDefinition: {
viewQuery: componentDefinition.viewQuery || null,
features: componentDefinition.features as DirectiveDefFeature[] || null,
data: componentDefinition.data || {},
// TODO(misko): convert ViewEncapsulation into const enum so that it can be used
// directly in the next line. Also `None` should be 0 not 2.
encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,
id: 'c',
styles: componentDefinition.styles || EMPTY_ARRAY,