Calling a method within a controller that's within a custom directive
<p>Been trying to figure this out for too long now. Maybe someone can shed some light:</p>

<p>Am experimenting with custom directives and as an exercise I'm trying to create a method within the custom directive's controller that can be called from a simple button within the view. But the method isn't being called, even though I can see the method (using console) as a property within isolated scope object. Any ideas please?</p>

<p>HTML:</p>

<pre><code>&lt;my-dir&gt;
    &lt;p&gt;My dir content&lt;/p&gt;
    &lt;p&gt;&lt;button ng-click="hideMe()"&gt;Hide element with isolated scope&lt;/button&gt;&lt;/p&gt;
&lt;/my-dir&gt;
</code></pre>

<p>JS:</p>

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

app.directive('myDir', function() {

    return {
        restrict: 'EA',
        scope: {},
        controller: ['$scope', function ($scope) {

            $scope.hideMe = function(){

                console.log('hideMe called');

            };

        }]
    };
})
</code></pre>