So, at some page www.B.com/somepage.html customer would put something like that:
<base href="https://www.A.com" />
<app-root></app-root>
<script src="runtime.469fa17746b90e8a757c.js" defer></script>
<script src="polyfills.35a5ca1855eb057f016a.js" defer></script>
<script src="scripts.3cf90f8fc92130239739.js" defer></script>
<script src="main.f229882672708596d13b.js" defer></script>
I tried this approach but encountered with a whole bunch of issues related to CORS and CORB.
Does anyone have a clear path on how a webpage can use Angular app from another domain?
EDIT NOTE 1: solution with iframe does not work for us because it negatively affects SEO (Google penalizes us for it), so we cannot use iframe with external link on our website.
EDIT NOTE 2: I have ownership of www.A.com (so I can adjust any configuration/HTTP headers required for my app to be used from external websites)
We can Do it in multiple ways
By using Angular Elements you can package Angular component as Web Component, a web standard for defining new HTML elements in a framework-agnostic way.
https://angular.io/guide/elements
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With