on-click function not called from a directive template
<p>I am a beginner in Angular and i'm trying to understand why in some cases my ng-click doesnt work depending on context.
First, here's my code, then i'll try to describe more precisely my problem.</p>

<p>HTML : </p>

<pre><code>&lt;div ng-app='myApp'&gt;
   &lt;section id="map-orders" ng-controller="ProductsController as products"&gt;
      &lt;div class="product-box" ng-repeat="products in products.products | orderBy:'name'"&gt;
         &lt;div class="product"&gt;
            &lt;h3&gt; {{products.name}} &lt;/h3&gt;
            &lt;span ng-click="remove($index)"&gt;Remove&lt;/span&gt;
         &lt;/div&gt;
      &lt;/div&gt;
   &lt;/section&gt;
&lt;/div&gt;
</code></pre>

<p>JS : </p>

<pre><code>var app = angular.module('myApp', [ ]);

app.controller('ProductsController', function(){
    this.products = products;   
    this.remove = function(index) {
        products.splice(index, 1);
    }
});

var products = [
    {
        name: "Carte 1", 
        generationDate: "03/03/2016",
    },
    {
        name: "Carte 2", 
        generationDate: "04/03/2016",
    }
];
</code></pre>

<p>So this code is working. But when i transform it by adding a directive : 
HTML : </p>

<pre><code>&lt;div ng-app='myApp'&gt;
   &lt;section id="map-orders" ng-controller="ProductsController as products"&gt;
      &lt;div class="product-box" ng-repeat="products in products.products | orderBy:'name'"&gt;
         &lt;product&gt;&lt;/product&gt;
      &lt;/div&gt;
   &lt;/section&gt;
&lt;/div&gt;
</code></pre>

<p>With this directive addiotionnaly to the original js : </p>

<pre><code>app.directive('product', function() {
    var tpl = '&lt;div class="product"&gt;' +
    '&lt;h3 {{products.name}} &lt;/h3&gt;' +
    '&lt;span ng-click="remove($index)"&gt;Remove&lt;/span&gt;'
    '&lt;/div&gt;';
    return {
        restrict: 'E',
    template: tpl,
    };
});
</code></pre>

<p>My remove() function doesnt work now. I don't get why.
Can somebody help me with that? If possible specifically with my code so i get the problem.</p>

<p>Thank you by advance</p>