ui-router-extras icon indicating copy to clipboard operation
ui-router-extras copied to clipboard

StickyStates based on view parameters

Open lrondanini opened this issue 9 years ago • 1 comments

Hi all,

sorry to post this here but I cannot find a better place.

What I'm trying to do is simple, I have a state that looks like this:

.state('app',{
            url: '/app/:id/:directive/:scriptUrl',
            templateProvider: function() { 
                return lazyDeferred.promise; 
            },
            resolve: {
                load: ['$ocLazyLoad','$q','$http','$stateParams','$compile', function($ocLazyLoad, $q, $http,$stateParams,$compile) {
                    lazyDeferred = $q.defer();
                    return $ocLazyLoad.load($stateParams.scriptUrl).then(function() {
                        //should call the back-end to get the name of the directive
                        //for now:
                        var template = "<"+$stateParams.directive+"></"+$stateParams.directive+">";
                        return lazyDeferred.resolve(template);
                    });

                }]
            }

        });

and I would like this to become a stickystate based on the parameters. In other words the sticky state would be "calculated" not on the state's name but on the state's parameters.

I don't think this is possible with the current ui-route-extras implementation. If this is right, I'd like to save myself sometime and see if you guys can point me in the right direction based on your experience with StickyStates before starting digging into ui-route. Of course I'll be happy to share my work with you.

Thanks

lrondanini avatar Aug 01 '15 22:08 lrondanini

Hi, I also investigate sticky state, it seems there is another tool called "Deep State Redirect" can solve that problem. http://christopherthielen.github.io/ui-router-extras/#/dsr

Regards, Linkan Chen

lkchen1128 avatar Aug 28 '15 20:08 lkchen1128