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
@Scymex help me to find this issue:
For anybody who might be using Jade, here's a quick gotcha: div(ui-view)
compiles to <div ui-view="ui-view"></div>.
What you need is div(ui-view="").
So, you can have ui-view
inside ng-include
, but need do this trick
Font: https://github.com/angular-ui/ui-router/issues/679
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();
});