Templarian / ui.bootstrap.contextMenu

AngularJS Bootstrap UI Context Menu
MIT License
259 stars 127 forks source link

Allow icons (as HTML) in menu item. #21

Open hoeni opened 9 years ago

hoeni commented 9 years ago

This way one can use icons in the menu elements like

      $scope.menuOptions = function(program) {
        return [
          [function() {return '<i class="fa fa-fw fa-pencil"></i> edit'},
            function ($itemScope) { console.log('edit') } ],
        ];
      };

If this shouldn't be the default I'd suggest a 4th parameter to each element containing options, to be open for future extensions:

      $scope.menuOptions = function(program) {
        return [
          [function() {return '<i class="fa fa-fw fa-pencil"></i> edit'},
            function ($itemScope) { console.log('edit') },
            true,
            {allowHtml: true}
          ],
        ];
      };
SuricateCan commented 9 years ago

I am working on a huge addition at the moment and a feature related to this will be on it.