LockettKs
LockettKs

Reputation: 482

Is it possible to add an Angular component within an existing pure Javascript project?

I want to add/create a new Angular component inside an existing pure Javascript library so that the library can be easily integrated within Angular apps. The Angular component will essentially be a wrapper for the library. We already added a React wrapper to the library for this same purpose.

Given that Angular is a framework solution, and I don't want to drastically change the structure of the existing JS project, is it possible to add Angular to the existing JS project? If so, how is that done from a high-level? I normally use Angular-cli v6 in my other projects.

Upvotes: 4

Views: 1056

Answers (1)

Muhammed Albarmavi
Muhammed Albarmavi

Reputation: 24472

Angular Elements

Angular elements are Angular components packaged as custom elements, a web standard for defining new HTML elements in a framework-agnostic way.

Building a Custom Element Using Angular Elements

Angular Elements — A Practical Introduction To Web Components With Angular 6

Browser support for custom elements

Chrome Supported natively.

Opera Supported natively.

Safari Supported natively.

Firefox Set the dom.webcomponents.enabled and dom.webcomponents.customelements.enabled preferences to true. Planned to be enabled by default in version 60/61.

Edge Working on an implementation.

Upvotes: 5

Related Questions