get a reference to the control from ng-click event
<p>I have a table row dynamically being populated with clickable images. When the image is clicked I need to pass its unique id to the controller. I have tried many different ways but so far unsuccessful. What I tried:</p>

<pre><code>&lt;td ng-repeat="Type in Types"&gt;
    &lt;img ng-src="../../Images/{{Type.Path}}" ng-title="{{Type.TypeId}}" ng-model="n_type" ng-click="Process()" /&gt;
&lt;/td&gt;

 $scope.Process = function () {
    console.log($scope.n_type);
    $scope.$parent.n_type = $scope.n_type;
 }
</code></pre>

<p>and</p>

<pre><code>&lt;td ng-repeat="Type in Types"&gt;
    &lt;div data-ng-init="imgId='{{Type.TypeId}}';"&gt;
        &lt;img ng-src="../../Images/{{Type.Path}}" data-ng-attr-id="imgId" ng-title="{{Type.TypeId}}" ng-model="n_type" ng-click="Process(imgId)" /&gt;
    &lt;/div&gt;   
&lt;/td&gt;

 $scope.Process = function () {
    console.log($scope.imgId);
    $scope.$parent.n_type = $scope.imgId;
 }
</code></pre>

<p>But in both cases the result is "undefined"</p>