angular/packages/core/test/render3
Alan Agius 02d5e8d79d fix(platform-browser): remove styles from DOM of destroyed components (#48298)
Currently style of components using `encapsulation`, `None` or `Emulated` will not be removed from the DOM once the component get destroyed.

This change addresses this by keeping track of the number of times a component is rendered, when the component is destroyed the counter is decreased and once this reaches zero the style element is removed from the DOM.

Currently, this new behaviour is on opt-in bases, but it will be changed in the next major version.

To opt-in, set the `REMOVE_STYLES_ON_COMPONENT_DESTROY` DI token to `true`.

Example
```ts
@NgModule({
 declarations: [
   AppComponent,
 ],
 imports: [
   BrowserModule
 ],
 providers: [
   { provide: REMOVE_STYLES_ON_COMPONENT_DESTROY, useValue: true }
 ],
 bootstrap: [AppComponent]
})
export class AppModule { }
```

Closes #16670

PR Close #48298
2023-02-16 15:31:24 -08:00
..
i18n refactor(core): remove debug data structures (#48281) 2022-11-30 09:27:59 -08:00
instructions refactor(core): remove debug data structures (#48281) 2022-11-30 09:27:59 -08:00
interfaces ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
ivy build: ensure bootstrap transitive runfiles are made available (#48521) 2022-12-19 19:50:41 +00:00
jit test: refactor render3 definition feature test to be less sensitive to JS output (#48521) 2022-12-19 19:50:42 +00:00
perf test(core): migrate tests off of Renderer3 interfaces (#46605) 2022-06-30 09:04:56 -07:00
styling_next refactor(core): Ensure that previousOrParentTNode always belongs to current TView. (#38707) 2020-09-28 16:15:58 -04:00
util test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
BUILD.bazel build: ensure bootstrap transitive runfiles are made available (#48521) 2022-12-19 19:50:41 +00:00
change_detection_spec.ts refactor(core): drop unused fields from the RootContext (#46806) 2022-08-05 09:58:06 -07:00
component_ref_spec.ts refactor(core): remove unused private APIs (#48234) 2022-11-28 09:11:25 -08:00
di_spec.ts test(core): update di_spec.ts to use TestBed (#46522) 2022-06-27 15:15:50 -07:00
es2015-tsconfig.json fix(core): destroy hooks not set up for useClass provider using forwardRef (#44281) 2021-11-30 11:56:05 -05:00
global_utils_spec.ts feat(core): introduce getDirectiveMetadata global debugging utility (#41525) 2021-04-13 16:06:32 -07:00
i18n_debug_spec.ts build: bundle spec files for saucelabs legacy job (#44281) 2021-11-30 11:56:04 -05:00
imported_renderer2.ts fix(platform-browser): remove styles from DOM of destroyed components (#48298) 2023-02-16 15:31:24 -08:00
instructions_spec.ts test(core): update various tests to avoid referencing TemplateFixture (#46571) 2022-06-29 10:01:35 -07:00
integration_spec.ts feat(core): support TypeScript 4.8 (#47038) 2022-08-16 16:02:47 +00:00
is_shape_of.ts refactor(core): remove assumptions that component will be first in directives list (#47490) 2022-09-21 10:05:32 +02:00
is_shape_of_spec.ts ci: add lint error for files with missing trailing new-line (#42478) 2021-06-04 13:31:03 -07:00
jit_environment_spec.ts refactor(compiler-cli): introduce declaration function to declare class metadata (#41200) 2021-04-12 10:41:17 -07:00
load_domino.ts build: clean up references to old master branch (#45856) 2022-05-04 16:23:33 -07:00
matchers.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00
matchers_spec.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00
metadata_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
node_selector_matcher_spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
providers_helper.ts test(core): convert providers test utility to TestBed (#46527) 2022-06-27 15:15:00 -07:00
providers_spec.ts test(core): use TestBed & JIT instead of handwritten defs in providers_spec (#46527) 2022-06-27 15:15:00 -07:00
query_spec.ts test(core): refactor tests to use TestBed instead of hand-written instructions (#46561) 2022-06-28 21:28:21 -07:00
testing_spec.ts test: update tests to account for karma-jasmine v5.0.0 2022-07-18 19:19:00 +02:00
utils.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00
view_fixture.ts test(core): update various tests to avoid referencing TemplateFixture (#46571) 2022-06-29 10:01:35 -07:00
view_utils_spec.ts fix(core): Store ICU state in LView rather than in TView (#39233) 2020-10-21 18:33:00 -07:00