From the course: Creating Angular Libraries

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Make components portable with Angular Elements

Make components portable with Angular Elements - Angular Tutorial

From the course: Creating Angular Libraries

Make components portable with Angular Elements

- [Instructor] Angular elements lets you compile Angular components into industry standard web components you can use anywhere, even if those other projects don't use Angular. In this video, we'll look at one way you can use Angular elements with a custom library to build web components. I opened our project here in a GitHub code pace. I talk about why we use Codespaces earlier in this course, so for now, just think of them as an easy way to share and write code without installing anything on your local machine. From the root of our workspace, I'll go to projects, gem finder elements, source, and click on main.ts to open the file. When you generate web components using Angular elements, you're actually wrapping Angular components inside code that's compatible with web component APIs. Under the hood these components still need the Angular framework to operate, which means we need to host our code inside an Angular app of some kind. One way to do this is to create a new dedicated…

Contents