I have a few custom directives which are basically designed for <input>
.
And I have a custom component <app-decorated-input>
There are a ton <app-decorated-input>
s along with simple <input>
s in my application for some of which I like to use the directives and for others I don't. How do I pass on the directives to the underlying <input>
when the directive is used like so:
<app-decorated-input directive1 directive2 ></app-decorated-input>
and have the same effect of the directives on the underlying <input>
as if it were used directly on it:
<input type="text" directive1 directive2 >
UPDATE:
What lies inside <app-decorated-input>
is not much of relevance except the fact that it contains an <input>
as I have already mentioned. Its template looks something similar to:
<div> Some decorations here </div>
<div>
<input type="text" {...directives}> <!-- In ReactJS this is done by using {...this.props} -->
</div>
<div> Some decorations here too! </div>
All I want to do is transfer all the directives specified on the <app-decorated-input>
to the underlying <input>
.