DEV Community

Attia
Attia

Posted on

what is difference in angular use component or modals as element ref and what is it effect on performance in angular

I need to create an angular component as alert "are you sure to do xyz?" one of my colleagues used element ref and another use component. what is the difference and use cases of each one and what the effect of the performace

Top comments (1)

Collapse
 
hvojha profile image
Harshvardhan Ojha

I guess instead of creating a component, it is better to use which is already built. As all the edge cases are also covered by them. And you will only need to focus on your functionality. Every UI library has a modal in angular. I mostly use Ngmodal, provided by ng-bootstrap.

You can refer this:- ng-bootstrap.github.io/#/component...