Thursday, 20 April 2017

Possible collision between nodejs and angular routing

First of all I have a lot of experience working with HTML/CSS and browser Javascript (including AngularJS)

Now I started using NodeJS and also Angular(2).

Upto now I would have sworn that it is not possible to omit the hash character (or any similar character) from client routing, because (I thought) it would always go to the server for routing in that case.

Example: I have a nodejs express application which sends index.html when issuing a GET on /

Then there is a (client side) Angular app, which has its own routing with no hash character. So for example when I access /myroute from within the client app, it will use Angular routing to determine the view template that should be presented to the user.

I don't get that. Why doesn't it go to the server to determine the route? Also, if I enter the URL directly in the browser (including /myroute) it still manages to route using Angular.

What happens when I add a server side route to /myroute?

I am confused.



via devnull69

No comments:

Post a Comment