Fixed the event delegation in ng-repeat

I used jlfama/ui-select#4d14014d943a5450a2ad7bd24d8acc5810a3345a from #158, as a reference and only kept the fixes for the event delegation issues.