I am currently working on an Angular application using the MEAN stack. Here's a scenario: imagine you have an express route that queries the database and sends the results back in the response:
app.get('/api', function(req, res){
Todo.find({}, "", function(err,todos){
if (err)
res.send(err);
res.json(todos);
});
});
On the client-side:
Controller :
...
Todo.get().success(function(data){ //I used a $http call to get the service
$scope.todos = data;
});
When I visit localhost:8080/#/api, I can see my partial view alongside the requested data.
However, the issue arises when I omit the hashtag - I only see the JSON formatted response data without the partial view.
I also attempted to use HTML5 mode but encountered the same problem when reloading the page.
Any suggestions on how to prevent this behavior?