简体   繁体   中英

angular-ui-router shares state between multiple tabs in browser

I'm using $stateProvider to manage states using ui-router ~0.2.15 The problem is that when I open app in two or more windows/tabs in the same browser the state is shared between them, ie navbar and view are changed in all those tabs/windows.

Do you know how to overcome this issue? Thank you

I don't think ui-router is capable of this. Are you sure you are not using BrowserSync or something like this? Try to access your webapp in multiple browsers if it's synced and you have something like this then you definitely use something to sync your tabs. If you generated your app with fountainjs or something like that then it's certainly installed. if you have a package.json or something similar please attach it.


EDIT

Access the BrowserSync UI ( default port 3001 or 8080 ), access /sync-options and disable all the options not related to CodeSync , see attached : browser sync menu

gulp/server.js :

browserSync.instance = browserSync.init(files, {
    startPath: '/',

    ghostMode:false, // do ghost mode disabled.

    server: {
        baseDir: baseDir,
        middleware: middleware,
        routes: routes
    },
    browser: browser
});

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