I am using angularJS and kendoUI and create my own directive using by kendo. in grid directive I use kendogrid that it have a toolbar. i fill toolbar with html template but it cant trigger my function with ng-click.
here my sample code
directive.js
app.directive('fonixGrid', [function () {
return {
restrict: 'EA',
replace: true,
transclude: true,
scope: {
gridtoolbar :"="
},
template: '<div id="kendogrid" ></div>',
link: function (scope, element, attrs) {
element.kendoGrid({
toolbar: '<a ng-click=gridtoolbar.click()></a>',
editable: attrs.editable ? attrs.editable : true,
scrollable: attrs.scrollable ? attrs.scrollable : true,
sortable: attrs.sortable ? attrs.sortable : true,
};
}]);
Contoller.js
app.register.controller('userViewModelController', ["$scope",
, function ($scope) {
var onclick = function () {
console.log('clicked');
};
$scope.mytoolbar = { click: onclick };
}]);
index.html
<html>
<div>
<div>
<fonix:grid gridtoolbar ="mytoolbar " />
</div>
</div>
</html>