title: Call controller function when directive attribute changed
body: <p>My code so far:</p>
  
  <pre><code> .directive('ngSpreadsheet', function () {
        return {
            restrict: 'EA',
            scope: {
                curpart: '='
            },
            template: '&lt;div id="dataTable" class="dataTable"&gt;&lt;/div&gt;',
            controller: SpreadsheetController,
            link: function (scope, element, attrs) { 
                scope.$watch('curpart', function (val) {
                    console.log('curpart value changed, new value is: ' + val);
                    // here i want to call a function of the SpreadsheetController 
                    // or is there a better way, executing stuff when an attribute changed?
                });
            }
  
        }
    })
  
  
  var SpreadsheetController = (function () {
    ...
  
    SpreadsheetController.prototype.curPartChanged = function () {
          console.debug('curPartChanged');
      };
  })();
  </code></pre>