Is there a way for different directive calls on the same component to communicate between them?

Viewed 25

I created a small validation framework so i can validate input by only referencing what i'm trying to validate, an example of it would be:

<input type="text" EV [EVTarget]="imthetarget" [EVType]="'EVEmail'">
<span #imthetarget></span>
<button EV [EVSubmit]="">SUBMIT</button>

Now, once the client clicks the submit button i would like it to find all EV inputs and corresponding directives and check if they have any errors on them.

My bad solution: I could create a hidden input and just place all the errors there and just check that field before allowing the data submission but that does not feel correct and would be clumsy.

Is there a way for the same directive instantiated multiple times within the same component to communicate with each other ?

This mini-project repo: https://github.com/maritto/Easy-Validate

0 Answers
Related