简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM