Page:init doesn't fire on custom routing

Hey Guys,

I’m upgrading from v1 to v2 and i had my own routing in v1, now all of a sudden this doesn’t work anymore :frowning:

I disabled auto init like i did in v1
this.f7 = new Framework7({
root: ‘#app’,
id: ‘my.id’,
name: ‘My App’,
theme: ‘ios’,
panel: {
swipe: ‘right’,
},

		init: false,
		cache: false,

	}); 

// Init/Create main view
mainView = this.f7.views.create(’.view-main’, {});

Now this:
$$(document).on(‘page:init’, function(e)

Only fires the first time, not when a click on a link in v1 it did fire and i got the page info back in the event.

I just want it to work the old way with an ajax call every time a link gets clicked.

router.navigate(url) does nothing :frowning:

How can i solve this?

You need to init app: app.init() otherwise router won’t work

I did that, first page loads fine, when i click a link nothing happened

I was able to debug the router and it coudn’t find a route (is that mandatory?)

Yes, routes must be specified in order to work

Why is that? In v1 you could just send to any page you liked. What is the use for defining routes?

Because this is how v2 router works

Ok i understand, is there a way to add routes dynamically?