Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace Angular Component with another

I have a core angular library written in house. p.e. There is a component A which uses internally an date picker component with the selector my-date-picker. Many other components in the library use that date picker,too. The library is delivered to different customers. Now one of the customers doesnt want the datepicker. He builds an own datepicker component. Is there a simple way to replace the old datepicker with the new one? Something like overriding the selector...

EDIT: The additional/replacement components are not necessary provided by us. It is possible that our customer will develop it on his own.

Thank you an regards Stephan

like image 879
fuechsle Avatar asked Dec 09 '25 18:12

fuechsle


1 Answers

You could potentially create a boolean variable called isCustomerX, and check it.

If the component is ran by customer X, you can simply disable the control overall, and let them use whatever they want.

Or you could create a custom environment. There is an excellent explanation here

That way you'd be able to distribute the environment relevant only to that particular customer.

like image 129
mutantkeyboard Avatar answered Dec 11 '25 11:12

mutantkeyboard



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!