Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow for late loading of nested menu options #37

Closed
josetaira opened this issue Jan 20, 2016 · 3 comments
Closed

Feature: Allow for late loading of nested menu options #37

josetaira opened this issue Jan 20, 2016 · 3 comments

Comments

@josetaira
Copy link
Collaborator

Have a parameter you can specify that will be called to return the array that will be supplied to the nested menu before it is rendered. I'm thinking this can be simple function that returns the nested menu array which will be called before render menu of the nested arrays, or it can be an object, something like: {"nestedMenuLoader": function(){return []};}.

The object option might be better since from here any future new parameters can just be a new key in this object. Your thoughts?

@Templarian
Copy link
Owner

Probably easier to make context-menu="menuOptions" allow...

$scope.menuOptions = function (name) {
    var deferred = $q.defer();
    setTimeout(function() {
        deferred.resolve([
            // resolved menu items.
        ]);
    }, 1000);
    return deferred.promise;
}

It already allows a function that returns an array so returning a promise would be easier to understand.

@josetaira
Copy link
Collaborator Author

@Templarian yeah, seems logical. Any plans on implementing this any time soon?

@josetaira
Copy link
Collaborator Author

I've implemented this and created a PR here: #52

My implementation is a bit different that only nested menus are supported as promises. The main menu must be your default menu structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants