Routes - template to component

I have cordova SPA that contains a series of template DIVs . A global function called gotoDynamicPage is used to load these DIVs at run-time.

I can simply call “gotoDynamicPage(‘pageHome’)” or "gotoDynamicPage(‘pageTest1’) from anywhere in my SPA and it would load the desired page (div).

It worked well from v1 to v5, but no longer works in v6 since the “template” parameter is removed from routes. How do I achieve the same effect in v6?

Thanks for the help!

You need to migrate this logic to components (which are basically JS functions)