title: how to get the unique id of array element on click through angularjs from firebase database
body: <pre><code>HTML: 
   &lt;div ng-controller="getIdController"&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-md-6"&gt;
                      &lt;hr /&gt;
                      &lt;table class="table table-bordered"&gt;
                          &lt;thead&gt;
                              &lt;tr&gt;
                                  &lt;th&gt;Name&lt;/th&gt;
                                  &lt;th&gt;Age&lt;/th&gt;
                                  &lt;th&gt;Gender&lt;/th&gt;
                              &lt;/tr&gt;
                          &lt;/thead&gt;
                          &lt;tbody&gt;
                              &lt;tr ng-repeat="user in userData"&gt;
                                  &lt;td&gt; {{ user.name }} &lt;/td&gt;
                                  &lt;td&gt; {{ user.age }} &lt;/td&gt;
                                  &lt;td&gt; {{ user.gender }} &lt;/td&gt;
                                  &lt;td&gt;&lt;button class="btn btn-warning" ng-click="getObjectId()"&gt;Get Id&lt;/button&gt;&lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/tbody&gt;
                      &lt;/table&gt; 
                  &lt;/div&gt;
              &lt;/div&gt;   
          &lt;/div&gt;   
  &lt;/div&gt;
  </code></pre>
  
  <p>App Js:</p>
  
  <pre><code>var crudApp = angular.module('crudApp', ['firebase']);
  crudApp.controller('getIdController', ['$scope', '$firebaseArray', function($scope, $firebaseArray){
  
      var ref = new Firebase('https://blistering-fire-4719.firebaseio.com/users');
  
      $scope.userData = $firebaseArray(ref);    
  
      $scope.getObjectId = function(){
  
          $scope.userData.$loaded()
              .then(function(id){ 
  
              var obj = id;
  
              console.log(obj);          
  
          });
      }   
  }]);
  </code></pre>
  
  <p>Explanation:</p>
  
  <p>Ok here In firebase i have User table and it has 3 objects each with unique id. Currently I am trying to extract the unique id for object on click of Get Id button in html. But the problem is if I do console.log(id) the function getObjectId() gives me //Array [ Object, Object, Object ].. clicking on object takes me to its data and it has $id as -K9jyc0K9i28h53d23Uw.. </p>
  
  <p>Is there any way to get the unique id for a particular element on clicking the button</p>
  
  <p>I want this unique id to be shown for element on clicking a particular element/object in html.</p>
  
  <p>Please help.</p>