Skip to content Skip to sidebar Skip to footer

Angular-strap Collapse Plugin, Opening More Than One Panel At The Time (?)

Hello folks this is the plugin http://mgcrea.github.io/angular-strap/##collapses I am trying to use this plugin in my app but isn't doing what I want, I want to use it more dynamic

Solution 1:

If you look at the source code for the angular-strap collapse control here, you will notice this function inside the controller:

self.$setActive = $scope.$setActive = function(value) {
    if(!self.$options.disallowToggle) {
        self.$targets.$active = self.$targets.$active === value ? -1 : value;
    } else {
        self.$targets.$active = value;
    }
    self.$viewChangeListeners.forEach(function(fn) {
        fn();
    });
};

As you can see $targets.$active is a single value, meaning that the directive only accommodates one panel open at a time. To alter the functionality of the directive, you would have to fork it and make the necessary changes.

I would look at my answer to your similar question as a better approach. You do not need a library/plugin to get the result you are looking for. See: https://stackoverflow.com/a/27611923/277697

Post a Comment for "Angular-strap Collapse Plugin, Opening More Than One Panel At The Time (?)"