angular/packages/platform-browser/test
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
..
browser feat(platform-browser): add isEmpty method to the TransferState class (#46915) 2022-07-22 09:17:47 +00:00
dom fix(platform-browser): remove styles from DOM of destroyed components (#48298) 2023-02-16 15:31:24 -08:00
security test: clean up internal testing utilities (#42177) 2021-05-26 20:07:25 +00:00
static_assets refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
browser_util_spec.ts refactor(animations): Remove unnecessary IE specific code (#44686) 2022-01-12 20:43:23 +00:00
BUILD.bazel build: fix legacy saucelabs test bundle generation after ESM changes (#48521) 2022-12-19 19:50:44 +00:00
testing_public_spec.ts build: update to jasmine 4.0 (#45558) 2022-04-11 16:25:28 +00:00