Following the new SPA NodeJS tutorial, I created a new project and set it up as explained. The SPA part is working great along with the layout architecture.
But the issue described here is same the I am experiencing… making the current setup still kind-of unusable.
Here is my setup:
Layout Page: main.ejs
Content Pages: home, service, contact (.ejs)
I have set the route for home to be “/”, so that is the content page that gets loaded when “localhost:3000” is opened.
I am also able to open other content pages directly using URL, similar to PHP/ASP implementation (which was earlier broken).
Now, if I load URL with “/” or any other content page path, that page refuses to recognize or get rendered by DMX (not sure what the term here would be). But the layout page renders fine. Only the HTML of content page is broken.
So, this is how the HTML gets rendered - with the dmx-on:click
event not rendered by DMX.
So these buttons don’t do anything on clicking.
Another thing to notice here is any components on layout page (browser, sc, variables etc) also don’t work at this point.
Now, I have an internal link on the layout page, which can take me to another page.
This new content page loads perfectly fine, with all components working fine too. There are no un-rendered DMX HTML attributes either.
Now, interestingly, if using another link in the newly loaded content page or the layout page and go back to the content page I had originally loaded, that renders correctly as expected.
As you can see, no more DMX tags. And, clicking on the buttons correctly executes the browser1.goto
method too.
The issue here is just with the first page being rendered the first time.
If you guys could share a fixed JS file for it, it would be great.