title: Passing variable to directives, with array push
body: <p>My controller contains an array. Each item in the array is a directive with template. How do I get value to directive when I push a new one? I want to send ID to directive when I push new item.</p>
  
  <p>Controller</p>
  
  <pre><code>(function () {
    'use strict';
  
  angular
    .module('app')
    .controller('dashboardController', dashboardController);
  
  dashboardController.$inject = ['$scope', '$timeout', '$state', 'apiService'];
  
  function dashboardController($scope, $timeout, $state, apiService) {
  
  $scope.newCMP = newCMP;
  $scope.openCMPArray = [];
  
  function newCMP() {
    $scope.openCMPArray.push({id:"3"});
  }
  
  
  }
  
  })();
  </code></pre>
  
  <p>Directive</p>
  
  <pre><code>(function () {
    'use strict';
  
    angular
        .module('app')
        .directive('gpCmpForm', cmpForm);
  
    function cmpForm() {
      return {
        scope: {
          id: '=id' //I've tried doing a lot of different mapping here
        },
         restrict: 'A',
        templateUrl: '/app/views/cmpForm.html',
        controller: function ($scope) {
          $scope.test = "342";
        }
      }
   };
  })();
  </code></pre>
  
  <p>How does the directive get the ID when it is created?</p>