[SOLVED] router.clearPreviousPages() - Not working

it never works!

app.views.main.router.clearPreviousPages();

VM8357:67 Uncaught TypeError: app.views.main.router.clearPreviousPages is not a function
at HTMLElement. (:67:42)

pageInit: function(e, page) {
var self = this;
$('.badge-pro-add').on('click', function(e) {

app.views.main.router.clearPreviousPages();
// or
app.router.clearPreviousPages();
self.router.clearPreviousPages();
        });
},

Покажите код, где у вас инициализируется view.

1 Like

`
mainView.router.clearPreviousPages(); -> this is not working !

mainView.router.clearPreviousHistory(); -> this is working !

 var app = new Framework7({       
        root: '#app',
        theme: theme,  
        view: {
            iosDynamicNavbar: false,
            xhrCache: false,
        },
        routes: routes,
    });

    var mainView = app.views.main;
    mainView.router.navigate('/home/');

Тут нет кода инициализации view.
clearPreviousPages доступен с 3.6.0
clearPreviousHistory доступен с 2.0.10

thank you. İt is work