问题描述
限时送ChatGPT账号..有没有办法将 Angular2 组件导出为独立的小部件?我知道它可能需要附加 angular2 内核本身,这不是问题(除非可以省略).
Is there a way to export Angular2 Component as a standalone widget? I am aware it would probably require attaching angular2 core itself, that is not a problem (unless can be omitted).
我的目标是创建一个完整的应用程序(系统),其中包括一个共享组件(如特定于产品的照片库).我希望该组件可以导出,以便有人可以将其包含在他们的页面上(不必是 Angular2).
My aim is to create a full app (system), which includes a shared component (like a product specific photo gallery). I would like that component to be exportable so somebody can include that on their page (which doesn't have to be Angular2).
这可能吗?
推荐答案
当我问最初的问题时它不可用,但现在可以使用 Angular Elements 将 Angular 组件导出为自定义元素:https://angular.io/guide/elements
It wasn't available back when I asked the original question, but now it is possible to export Angular Components as Custom Elements using Angular Elements: https://angular.io/guide/elements
这篇关于将 Angular2 组件导出为独立小部件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论