Commit Graph

6 Commits

Author SHA1 Message Date
George Kalpakas bdce7698fc fix(elements): update the view of an `OnPush` component when inputs change (#39452)
As with regular Angular components, Angular elements are expected to
have their views update when inputs change.

Previously, Angular Elements views were not updated if the underlying
component used the `OnPush` change detection strategy.

This commit fixes this by calling `markForCheck()` on the component
view's `ChangeDetectorRef`.

NOTE:
This is similar to how `@angular/upgrade` does it:
3236ae0ee1/packages/upgrade/src/common/src/downgrade_component_adapter.ts (L146).

Fixes #38948

PR Close #39452
2020-11-06 09:31:46 -08:00
George Kalpakas c1907809a8 test(elements): add integration tests for Angular Elements using `ShadowDom` (#39452)
Previously, the project used for running integration tests for Angular
Elements declared a component that used `ShadowDom` for view
encopsulation, but it did not include any tests to verify that the view
was updated correctly.

This commit adds the missing tests.

PR Close #39452
2020-11-06 09:31:46 -08:00
George Kalpakas 53bae68617 test: make `elements` integration tests less flaky (#26869)
PR Close #26869
2018-11-02 10:37:34 -07:00
Rob Wormald a8210d010b fix(elements): strict null checks (#24861)
PR Close #24861
2018-08-30 21:33:14 -07:00
Rob Wormald c9844a2f01 feat(elements): enable Shadow DOM v1 and slots (#24861)
When using ViewEncapsulation.ShadowDom, Angular will not remove the child nodes of the DOM node a root Component is bootstrapped into. This enables developers building Angular Elements to use the `<slot>` element to do native content projection.

PR Close #24861
2018-08-30 21:33:14 -07:00
Rob Wormald 4815b92495 test(elements): add basic integration test for angular elements (#24861)
PR Close #24861
2018-08-30 21:33:14 -07:00