I have a directive which takes an event when a change is detected in an input, I would like to create many inputs with the same directive.
For example:
<body ng-controller="MainCtrl">
<input ng-model='val' caret="2"><br/>
<input ng-model'"val2' caret="2"><br/>
<input ng-model'"val3' caret="2"><br/>
<input ng-model'"val4' caret="2"><br/>
....
<input ng-model'"valn' caret="2"><br/>
</body>
The problem is that the first parameter of scope.$watch is the model name. How can I make the scope.$watch work with dynamic inputs?.