I created a customized component to enhance the appearance of bootstrap form controls, intended for use in various projects. I am considering transforming this into a library (a separate npm package with its own @NgModule), but some projects may wish to modify the template. How can I make this process more user-friendly for them?
Initially, I tried extending the component class and using a different template within the @Component decorator, resulting in the following error:
[ERROR ->]<form-control labelKey="Issue.StoryPoints" helpKey="Effort estimate by the development team">
<in"): ng:///AppModule/EditIssueComponent.html@34:2
More than one component matched on this element.
Make sure that only one component's selector can match a given element.
Conflicting components: FormControlComponent,MyFormControlComponent ("
</form-control>
While I could change the selector, doing so after the fact would require updating all instances across templates. Specifying a unique selector from the start is reminiscent of YAGNI...
Am I overlooking a better approach?
It seems counterintuitive for a framework that easily allows provider overrides to lack support for component overriding :-(