Replace ngShow with ngSwitch for reasons explained in http://stackoverflow.com/questions/20316370/validation-directive-code-is-executed-on-every-item-in-ng-repeat