How to dynamically add a directive to all input elements in AngularJS across controllers & modules
<p>I want to add a directive dynamically to all my textboxes in all my controllers &amp; forms.
I got a hack from here : <a href="https://stackoverflow.com/questions/24333911/how-to-dynamically-add-a-directive-to-an-input-element-in-angularjs">How to dynamically add a directive to an input element in AngularJS</a></p>

<p>but in my case: there are around 200+ forms spread across different controllers &amp; modules &amp; it will be very time consuming to add it everywhere. </p>

<p>Is there an easier or more elegant way to do it ?</p>

<p><strong>Edit:</strong> What I want to do ?
I want to remove all leading &amp; trailing spaces entered by user in all input boxes.</p>