diff --git a/src/views/listview/list-view-directive.js b/src/views/listview/list-view-directive.js index 9f7ab7c84..7d7577fd0 100644 --- a/src/views/listview/list-view-directive.js +++ b/src/views/listview/list-view-directive.js @@ -28,6 +28,9 @@ * * @param {function (action, item))} enableButtonForItemFn function(action, item) Used to enabled/disable an action button based on the current item @@ -120,8 +123,8 @@ - angular.module('patternfly.views').controller('ViewCtrl', ['$scope', - function ($scope) { + angular.module('patternfly.views').controller('ViewCtrl', ['$scope', '$templateCache', + function ($scope, $templateCache) { $scope.eventText = ''; var handleSelect = function (item, e) { $scope.eventText = item.name + ' selected\r\n' + $scope.eventText; @@ -239,6 +242,9 @@ $scope.eventText = item.name + " : " + action.name + "\r\n" + $scope.eventText; }; + var buttonInclude = '{{actionButton.name}}'; + + $templateCache.put('my-button-template', buttonInclude); $scope.actionButtons = [ { name: 'Action 1', @@ -247,8 +253,15 @@ }, { name: 'Action 2', + class: 'btn-primary', title: 'Do something else', actionFn: performAction + }, + { + name: 'Action 3', + include: 'my-button-template', + title: 'Do something special', + actionFn: performAction } ]; $scope.menuActions = [ diff --git a/src/views/listview/list-view.html b/src/views/listview/list-view.html index e2e533f3f..849b8d65f 100644 --- a/src/views/listview/list-view.html +++ b/src/views/listview/list-view.html @@ -8,11 +8,12 @@
-