Having trouble with my directive not calling the controller method. Here's the code I'm using:
Controller:
exports.controller = ['$scope', function($scope) {
$scope.addParamter = function () {
console.log("here");
};
$scope.editParamter = function (item) {
console.log(item);
};
}];
Page:
<formula-editor
add-paramter="addParameter()"
edit-paramter="editParameter(item)">
</formula-editor>
Directive:
Js:
exports.inject = function(app) {
app.directive('formulaEditor', exports.directive);
return exports.directive;
};
exports.directive = function () {
return {
restrict: 'E',
templateUrl: '/dist/views/formula-editor.html',
scope: {
addParameter: '&',
editParameter: '&'
}
};
};
formula-editor.html:
<button ng-click="addParameter()"></button>