I’ve been using Angular’s
.when for displaying the hmtl routes of my application. For this I have configured a main route:
var appRoutes = require('./backend/routes/api');
I was trying to add another route this way but most of the html wasn’t displaying correctly, so I configured another main route:
var questions = require('./backend/routes/questions');
in the file where I use Angular’s
.when, I added a route for /questions but it doesn’t load it properly (some elements are not shown). That’s why in the questions.js file where I configure the /questions route, I’m using router.get to render the questions.html page.
router.get makes it work but only after reloading the browser once I’m on the correct URL(127.0.0.1:3000/questions).
If I only use
.when it takes me to the page that doesn’t load properly, and if I use only
router.get it doesn’t load it at all.
Is there a way to fix this?