As part of my Angular 2 app I generate a list 'views', containing the paths to a bunch of images. I use ng-repeat to cycle through the images and display them 1-by-1 in a ui-view. I'd like to add an event listener to this so that when an image clicked, the image src is added to an array. Clicking the image again would remove it from the array. I've taken a look at involving a jquery plugin Image Picker, but that quickly becomes too messy.
Isn't there a way to do this from Angular 2 natively?
views.html
<body>
{{views.length}} views found.
<br>
<div style="display:inline-block" ng-repeat="x in views">
<section ui-view>
<img src={{x}} alt={{x.substring(20,60)}} style="width:192px;height:192px;">
</section>
</body>