I\'m trying to refresh a page and execute client route to open a template inside ng-view
Index.jade
extends layouts/default
block c
You're using HTML5 routes with a hashbang fallback. What that means is you want to set your server up so that requests to /cameras/12
redirect to /#!/cameras/12
. The server will then render your Angular application, which will detect that it wants to go to your viewCamera
state and will rewrite the url on the client.
You can accomplish this by simply adding the following middleware to your express app:
app.use(function (req, res, next) {
res.set('Location', '/#!' + req.path)
.status(301)
.send();
});