How do I get the history, name etc of the current view?
Im trying to get the below to work.
It is inside my page init.
var view = app.views.current();
console.log (app.view.name)
if (!view) return;
if (view.history.length > 1) {
mainView.router.back();
return;
}
And I get this error.
TypeError: app.views.current is not a function. (In ‘app.views.current()’, ‘app.views.current’ is an instance of View)
Ok, so this works.
var view = app.views.current;
console.log (app.view.name)