What does Angular recommend for Polyfilling support for custom elements built with Angular?
This demo works with only this polyfill added to polyfills.ts
:
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'
This article says we should include the following in polyfills.ts
:
import "@webcomponents/custom-elements/src/native-shim";
import "@webcomponents/custom-elements/custom-elements.min";
And this article says we should add the following to index.html
:
<script src="webcomponents/webcomponents-loader.js"></script>
<script>
if (!window.customElements){document.write('<!--');}
</script>
<script src="webcomponents/custom-elements-es5-adapter.js"></script>
<!-- ! DO NOT REMOVE THIS COMMENT, WE NEED ITS CLOSING MARKER -->
So there are differences. Which approach is the correct one for Angular 9 projects when deploying custom elements built with Angular?