Father, Software Engineer
Shipped with v6.0.0
Framework Independent
Portable Angular Components
<html>
...
<script src="ng-calendar.js"></script>
...
<ng-calendar></ng-calendar>
...
</html>
Custom Elements 👉 Docs
Rob Wormland 👉 Repo
Same API as native DOM (attributes, properties, methods, events)
customElements.define('ng-calendar', CalendarComponent);
Familiar Lifecycle Callbacks (connected, disconnected, adopted, attributeChanged)
Chrome, Safari, Opera natively
We have polyfills
What we need is:
import { createCustomElement } from '@angular/elements';
...
const calendar = createCustomElement(CalendarComponent, { injector });
customElements.define('ng-calendar', calendar);
Pascal Precht
Angular Elements Slideshow
Tomes Sułkowski
Building Custom Elements with Angular 6
Ben Tedder