wghglory / angular-custom-elements

angular custom elements usage in react app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular custom elements in React app

img1

img2

Convert an Angular Component to a Custom Element

  1. In angular app, run ng build --prod --output-hashing none to build without hash in file names.

  2. Copy dist folder's files into react project.

  3. Add your component to entryComponents. This is required for any component that is defined, but not directly declared in the app.

  4. Implement the ngDoBootstrap method to manually bootstrap that app.

  5. Call createCustomElement to covert Angular's component architecture to native DOM APIs.

References

About

angular custom elements usage in react app


Languages

Language:TypeScript 65.4%Language:HTML 19.0%Language:JavaScript 10.0%Language:CSS 5.7%