0

I successfully installed angularJS in my symfony app.

When "/" is called my symfony controller matches the route on a specific template. This is the only time a symfony controller action is called.

The entire rest of the application is routed through angularJS - route.

All angularjs specific views are located in

web/*

When i click a link i.e. "/friends", the proper html-file is loaded.

The url is:

http://example.com/friends

When i click an other link i.e. "/trash", the proper html-file is loaded too.

The url is:

http://example.com/trash

But when i reload the page, symfony tries to find a route "/trash" and throughs an error 404.

Is there any way to get around this?

Thanks and Greetings!

1
  • develop UI as separate project. Doing this you will avoid same problems. Commented Nov 25, 2015 at 7:24

1 Answer 1

1

That's because you are sending a http request, and symfony2's kernel it processes with Routing, if you see The Symfony Application Flow you can better understand. How to solve this?, I personally use ui-router (the routing framework for AngularJs) with this, your url will be like this: http://example.com/#trash, (with # ), you can see this tutorial for more details. If you need more help put the code on github, my user account is ricky6982.

Sign up to request clarification or add additional context in comments.

1 Comment

sorry for late answer, but thanks for answer! great! upvote

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.