简体   繁体   中英

AngularJS html5mode with fancybox

I'm using fancybox with angularjs. Fancybox works fine without html5mode but if I enable html5mode page redirects to root when fancybox is shown.

I've solved the problem by preventing routing.

$scope.$on('$locationChangeStart', 
    function (event, next, current) {
        if (next.indexOf('/images/') > 0) {
                event.preventDefault();
            }
        });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM