Using components as Angular elements
We have already learned how to use the Angular CLI for creating an Angular library. We also saw how to publish our library to the npm
registry so that other Angular projects can use it and benefit from it. In this section, we will go the extra mile and learn how to build our Angular library to be used in non-Angular environments.
As we have already pointed out, the Angular framework is a cross-platform JavaScript framework in many ways. It can run on the server using Angular Universal, and on mobile platforms. It can also run on a native desktop environment. In addition to those platforms, it can even run on web applications that are not built with Angular, using Angular elements.
Let's see how we can convert our clipboard component to an Angular element, as follows:
- Execute the following Angular CLI command to generate a new Angular application in our workspace:
ng generate application ui-elements --defaults
The preceding command...