In my directive, I have a controller variable, page which gets incremented when you press the button in the directive. However, the next line, scope.alertPage()
Try doing this slightly differently. Pass in a function to do the increment rather than incrementing inside the directive
HTML
Controller
$scope.incPage = function() { // Function to increment
$scope.page++;
};
In Directive
scope: {
page: '&', // Receive like this
alertPage: '&'
},
link: function(scope, elem, attrs) {
scope.incrementPage = function() {
scope.page(); // Call as function
scope.alertPage();
}
}