Having an issue with the Kendo UI toolbar where all buttons are loaded during initialization, but there are requirements to add buttons dynamically. Here's how buttons are loaded in a page controller:
...
$scope.toolbarButtons = [{
type: 'button',
text: 'Button 1',
click: 'clickButton1'
}, {
type: 'toggleButton',
text: 'Button 2'
}, {
type: 'button',
text: 'Button 3'
}
...
And here is how we add the toolbar and pass the buttons to the directive :
<toolbar buttons="toolbarButtons"></toolbar>
return {
scope: false,
restrict: 'E',
template: '<div kendo-toolbar="toolbar"></div>',
controller: 'ToolbarController',
link: function ($scope, element, attr) {
$scope.buttons = $scope[attr.buttons];
// Code to manage the toolbar
...
};
Attempting to change the scope binding of the buttons array using:
scope: {
buttons: '='
}
However, when adding a button in the toolbarButtons array, the button is not displayed.