- Create Angular Element Library
ng add ngx-build-plus --project elements
- Run
ng build --project elements --prod --single-bundle --output-hashing none
to build the elements to a single bundle. - Update your
angular.json
to include elements in your app
..
"scripts": [
"dist/elements/main-es5.js"
]
...
- Define
schemas: [CUSTOM_ELEMENTS_SCHEMA]
in yourAppModule
. - Use it in your template
<lib-component></lib-component>
. - Profit 💆