title: How to reuse controller without adding a similar one? Angular1.5
body: <p>I've done 2 tables(customers , items ) CRUD pages in my web app.</p>
  
  <ol>
  <li><p>CRUD customer table(customer.html) </p></li>
  <li><p>CRUD Item table(item.html)</p></li>
  </ol>
  
  <p>I'm trying to make a new page , which is similar to CRUD customer.html page but can CRUD one specific customer id's items.</p>
  
  <p>the way i'm going to make it is copying two similar pages I've done.</p>
  
  <p>customer.html -> crudOneCustomersItems.html </p>
  
  <p>item.html -> item2.html</p>
  
  <p>Then I created another 1 controller:itemCtrl2 in app.js , copy similar code but changed data source(items belong to one customer's id).</p>
  
  <p>crudOneCustomersItems.html 
  item2.html
  But I think maybe I can reuse same controllers , how can I make it in Angular1.5??</p>
  
  <p>my demo plunker: <a href="https://plnkr.co/edit/4hfNde9tLIIDzZRJAlhe" rel="nofollow">https://plnkr.co/edit/4hfNde9tLIIDzZRJAlhe</a></p>
  
  <pre><code>app.controller('CustomerCtrl', function($scope) {
  
  // making data start 
  $scope.customer = {
    id:1,
    name:'jason',
    email:'pp@pp.cc'
  };
  $scope.customers = [];
  
  for(var i = 1 ; i &lt; 20 ; i++){
      var temp = angular.copy($scope.customer);
      temp.id = i;
      temp.name = temp.name+i;
      temp.email = temp.name+i;
  
      $scope.customers.push(temp);
  }
  
  //making data end
  });
  
  app.controller('ItemCtrl', function($scope) {
  // making data start 
  $scope.item = {
    id:1,
    customerId: 2,
    name:'bomb',
    description:'it can explode'
  };
  $scope.items = [];
  
  for(var i = 1 ; i &lt; 20 ; i++){
      var temp = angular.copy($scope.item);
      temp.id = i;
      if(i&lt;10){
        temp.customerId =2;
      }
      else{
        temp.customerId =3;
      }
      temp.name = temp.name+i;
      temp.description = temp.name+i;
  
      $scope.items.push(temp);
  }
  
  
  //making data end
  });
  
  app.controller('ItemCtrl2', function($scope) {
  // getting selected data (customer id from querying parameter )
  });
  </code></pre>
  
  <p>Thanks</p>