title: How to pass scope variable through ng-click function?
body: <p>Here when i click on cartDetails the dynamic scope variable x.SmId value need to be passed to the bellow function and in alert box need to display the parameter .How can we do this one in angular js?  </p>
  
  <pre><code>&lt;div ng-app="" ng-controller="MyCtrl"&gt;
       &lt;div ng-repeat="x in names"&gt;
         &lt;div ng-click="cartDetails('{{x.SmId}}')"&gt;
          &lt;div&gt;{{x.name}}&lt;/div&gt;
         &lt;/div&gt;
       &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;script&gt;
   angular.module('MyApp', [])
  .controller('MyCtrl', ['$scope', '$http', function($scope, $http) {
    $scope.search = function(param) {
  
        $http.get('AngularJs-Response.jsp?mid='+param).success(function(response) {
          $scope.names = response;        
        });
  
    };
    $scope.cartDetails = function(smid) {
        alert(smid);
        };
  }]);
  &lt;/script&gt;
  </code></pre>