passing an object as param in ng-click
<p>I'm using angularjs datatable, and I've added action buttons to this datatable.</p>

<p>I have a button which I named <code>Edit</code> so this button will call a function with the current row informations in it as following :</p>

<pre><code>&lt;button class="btn btn-bl btn-success btn-ef btn-ef-5 btn-ef-5b mb-10" ng-click="openEditModal('+data+')"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; &lt;span&gt;'+$scope.update+'&lt;/span&gt;&lt;/button&gt;
</code></pre>

<p>which doesn't work, and this is the error I get :</p>

<blockquote>
  <p>error: [$parse:syntax] Syntax Error: Token 'Object' is unexpected,
  expecting []] at column 23 of the expression [openEditModal([object
  Object])] starting at [Object])].</p>
</blockquote>

<p>But when I pass a param to my function as this : <code>ng-click="openEditModal('+data.id+')"</code> it works, but I want to pass the whole object.</p>

<p>This is the code of <code>openEditModal()</code> :</p>

<pre><code>$scope.openEditModal = function(user) {
      $scope.user = user;
      console.log($scope.user);
      $uibModal.open({
        templateUrl: 'edit.tmpl.html',
        controller: 'EditModalInstanceCtrl',
        size: 'lg',
        resolve: {
          user: function () {
            return $scope.user;
          }
        }
      });
    };
</code></pre>

<p>and this is <code>EditModalInstanceCtrl</code> :</p>

<pre><code>.controller('EditModalInstanceCtrl', function ($scope, $uibModalInstance, user,$state) {
    $scope.user = user;
    // function to submit the form after all validation has occurred
    $scope.confirmEdit = function(isValid) {
      // check to make sure the form is completely valid
      if (isValid) {
        console.log('our form is amazing');
        $uibModalInstance.close();
        console.log(user);
        $state.go($state.current, {}, {reload: true});
      } else {
        console.log('form is invalid');
      }
    };
</code></pre>

<p>and this is the code of my datatable controller :</p>

<pre><code>.controller('CandidaturesDatatableCtrl', function ($scope, DTOptionsBuilder, DTColumnBuilder) {
    var vm = this;
    vm.dtOptions = DTOptionsBuilder.fromSource('http://www.filltext.com/?rows=10&amp;id={index}&amp;firstname={firstName}&amp;lastname={lastName}&amp;city={city}&amp;contactemail={email}&amp;message={lorem|50}&amp;pretty=true')
      .withPaginationType('full_numbers')
      .withBootstrap()
      // Active Responsive plugin
      .withOption('responsive', true)
      .withOption('initComplete', function(settings) {
        // Recompiling so we can bind Angular directive to the DT
        $compile(angular.element('#' + settings.sTableId).contents())($scope);
      });
    vm.dtColumns = [
      DTColumnBuilder.newColumn('id').withTitle('ID'),
      DTColumnBuilder.newColumn('firstname').withTitle('First name'),
      DTColumnBuilder.newColumn('lastname').withTitle('Last name'),
      // .notVisible() does not work in this case. Use .withClass('none') instead
      DTColumnBuilder.newColumn('city').withTitle('City'),
      DTColumnBuilder.newColumn('contactemail').withTitle('Email'),
      DTColumnBuilder.newColumn('message').withTitle('Message').withClass('none'),
      DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable()
        .renderWith(function(data, type, full, meta) {
          if (true) {
            return  '&lt;button class="btn btn-bl btn-success btn-ef btn-ef-5 btn-ef-5b mb-10" ng-click="openEditModal('+data+')"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; &lt;span&gt;'+$scope.update+'&lt;/span&gt;&lt;/button&gt;&amp;nbsp;'
              + '&lt;button class="btn btn-danger btn-rounded btn-ef btn-ef-5 btn-ef-5b mb-10" ng-click="openDeleteModal('+data.id+')"&gt;&lt;i class="fa fa-trash"&gt;&lt;/i&gt; &lt;span&gt;'+$scope.delete+'&lt;/span&gt;&lt;/button&gt;';
          } else {
            return '';
          }
        })
    ];
  });
</code></pre>

<p>so here is the scenario I want, when I click on the update button this will trigger the  <code>ng-click="openEditModal('+data.id+')"</code> and then this function will open a modal passing the user object to it, and the edit.tmpl.html will be populated with user object attributes.</p>

<h1>How can I solve this ?</h1>