Do I need to bootst...
Do I need to bootst...
No, you do not need to bootstrap custom elements. Custom elements, which are a key feature of the Web Components standard, bootstrap automatically when they are added to the DOM and are destroyed when removed from the DOM. Once a custom element is added to the DOM, it behaves like any other HTML element without requiring any special knowledge of Angular or additional bootstrapping[1].
However, when working with Angular Elements, which are Angular components packaged as custom elements, there is a specific build flow for creating them. In this context, the term "bootstrap" is used differently. For Angular Element creation, the bootstrap module is ElementModule
instead of AppModule
. This is because ElementModule
is responsible for registering the component as a custom element in the browser's CustomElementRegistry
. The ElementModule
needs to implement the DoBootstrap
interface, and within it, the ngDoBootstrap()
method is used for the ...
senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào