Anything after the #
isn't sent to the server. So when you go to localhost:8080/#/api
, expressjs just sees a request to /
and returns the AngularJS template. AngularJS then routes the browser page using the /#/api
, which called the Todo.get()
and (I assume) makes a call to localhost:8080/api
, returning the data from the DB.
That's why you only get the data when you omit the hash and when you use html5 mode.
I would suggest changing your API call to:
/api/todos
- return data from the db
And change your AngularJS route to just use:
/todos
- show the partial and data requested