Templarian / ui.bootstrap.contextMenu

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

Allow context-menu options from function #7

Closed animsakari closed 9 years ago

animsakari commented 9 years ago

Being able to generate menu options dynamically might be useful. One way to do this would be to allow context-menu to be assigned either an array or a scope function that returned the same type of array. If the function was passed the menu scope, a developer could make the menu dynamic based on the specific scope and its current state. Something like... Line 71: } else if (typeof options === 'function') { renderContextMenu($scope, event, options($scope)); } else...

animsakari commented 9 years ago

Thought about this one some more, and it doesn't make sense. You can already make the expression whatever you want including a call to a function that returns an array and manually pass in whatever scope, row context, etc. that you want.