linnovate / meanio

meanio core module
MIT License
54 stars 73 forks source link

Allows propagation of a weight value, to be used in implementation #69

Closed jwebbdev closed 8 years ago

jwebbdev commented 9 years ago

This just allows users to add a 'weight' value. It isn't handled internally currently, just passed back to the app, but allows the controllers to use it, like:

    // Query menus added by modules. Only returns menus that user is allowed to see.
    function queryMenu(name, defaultMenu) {
      Menus.query({
        name: name,
        defaultMenu: defaultMenu
      }, function(menu) {
        menu.sort(function(a,b){return a.weight - b.weight});
        vm.menus[name] = menu;
      });
    }