Trigger router on page load ?
panpansh opened this issue · 2 comments
panpansh commented
// load page href = http://127.0.0.1:8080/test/2
router.on('/test/2', function () {
console.log('test 2');
});
is there a way to auto trigger data-navigo at first load please (without link click) ?
Regards.
panpansh commented
I miss the doc :/ https://github.com/krasimir/navigo/blob/master/DOCUMENTATION.md#resolving-routes
need some read sorry
panpansh commented
// load page href = http://127.0.0.1:8080/test/2
router.on('/test/2', function () {
console.log('test 2');
}).resolve();
just need to add ".resolve();"
Regards.