title: How to bind the data using ng-model in table row (inline editing)
body: <p>I have 3 values in an object <strong>empID,empName,empEmail</strong> like this
  my problem is in the function gettemplete function(),</p>
  
  <pre><code> var app = angular.module('myApp' , []);
  
  app.controller('myCtrl' , function($scope){
      $scope.count=0;
  $scope.employees = [{empID:$scope.count+1,empName:'lin',empEmail:'b@1.in'},{empID:$scope.count+1,empName:'test',empEmail:'aaa@3.com'}];
      $scope.employeeData = {};
      $scope.selected = {};
  
      $scope.addEmployee = function(){
  
          $scope.employees.push({
              empName : $scope.empName,
              empEmail : $scope.empEmail
          });
          console.log($scope.employees);
      };
  
      $scope.deleteEmployee = function(employee){
          var index = $scope.employees.indexOf(employee);
          $scope.employees.splice(index,1);
          console.log($scope.employees);
      };
  
      $scope.getTemplate = function (employee) {
          if (employee.empID === $scope.selected.empID){
              console.log(employee.empID);
              console.log($scope.selected.empID);
              console.log("edit");
              return 'edit';
          }
  
          else {
              console.log("display");
              console.log(employee.empID);
              console.log($scope.selected.empID);
              return 'display';
          }
      };
  
      $scope.reset = function () {
          $scope.selected = {};
          console.log($scope.selected);
  
      };
  
      $scope.add = function(){
          $scope.addEmployee();
      };
  
      $scope.editEmployee = function (employee) {
          $scope.selected = angular.copy(employee);
          console.log($scope.selected);
          console.log(employee);
          console.log($scope.selected);
      };
  
      $scope.updateEmployee = function(employee) {
          $scope.employees.push({
              empName : $scope.empName,
              empEmail : $scope.empEmail
          });
          console.log($scope.employees);
          $scope.getTemplate();
          $scope.reset();
      };
  });
  </code></pre>
  
  <p>Here goes my html code</p>
  
  <pre><code>&lt;body ng-controller="myCtrl"&gt;
          &lt;div&gt;
              &lt;h3&gt;List Employees&lt;/h3&gt;
              &lt;table class="table table-striped table-bordered"&gt;
                  &lt;thead&gt;
                      &lt;th&gt;empID&lt;/th&gt;
                      &lt;th&gt;Employee Name&lt;/th&gt;
                      &lt;th&gt;Employee Email&lt;/th&gt;
                      &lt;th&gt;Action&lt;/th&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;tr ng-repeat="employee in employees" ng-include="getTemplate(employee)"&gt;
                          &lt;script type="text/ng-template" id="display"&gt;
                              &lt;td&gt;{{employee.empID}}&lt;/td&gt;
                              &lt;td&gt;{{employee.empName}}&lt;/td&gt;
                              &lt;td&gt;{{employee.empEmail}}&lt;/td&gt;
                              &lt;td&gt;
                                  &lt;button type="button" class="btn btn-primary" ng-click="editEmployee(employee)"&gt;Edit&lt;/button&gt;
                                  &lt;button type="button" class="btn btn-danger" ng-click="deleteEmployee(employee)"&gt;Delete&lt;/button&gt;
                              &lt;/td&gt;
                          &lt;/script&gt;
                          &lt;script type="text/ng-template" id="edit"&gt;
                              &lt;td&gt;{{employee.empID+ 1}}&lt;/td&gt;
                              &lt;td&gt;&lt;input type="text" ng-model=employee.empName class="form-control input-sm"/&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;input type="text" ng-model=employee.empEmail class="form-control input-sm"/&gt;&lt;/td&gt;
                              &lt;td&gt;
                                  &lt;button type="button" class="btn btn-primary" ng-click="updateEmployee(employee)"&gt;Save&lt;/button&gt;
                                  &lt;button type="button" class="btn btn-danger" ng-click="reset()"&gt;Cancel&lt;/button&gt;
                              &lt;/td&gt;
                          &lt;/script&gt;
                      &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;table&gt;
              &lt;button ng-click="add()"&gt; Add row &lt;/button&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>I am able to display my empName and empEmail but I dont know how to display <strong>empID</strong>. I have a button called <em>addrow</em> to create a row in the table, so when I click that button I need the empID as counted a 3,4,5,...etc like that.</p>