Angular One Page Site Dont Work Properly When Enables $locationprovider.html5mode(true);
I have an application with the following routes on the server side Main path: / Api path: /api/* Partials path /partials/* I have a single page application with angular, with the
Solution 1:
Create a controller action in Symfony which generates index template for any given url as the LAST route (so your /api/ and /partials/ would still work), something like this:
/**
* @Route("/{any}", name="any", requirements={"any" = ".*"})
* @Template("DemoBundle:Index:index.html.twig")
*/
public function anyAction($any)
{
return array();
}
This will generate the index page for any url without issueing 404, and it will be up to AngularJS to route it
Post a Comment for "Angular One Page Site Dont Work Properly When Enables $locationprovider.html5mode(true);"