I decided to start learning AngularJS by making a simple app.
The server-side application is built with ExpressJs, but the resource used below (/movie/:id) are not implemented yet, so pointing to this URL will result in a 404 (Not Found) error. So only getting '/' works.
I wanted to see how a $resource behaved so I made this simple test :
var app = angular.module("app", ["ngResource"]);
app.factory("Movie", function ($resource) {
return $resource("/movie/:id");
})
app.controller("MovieCtrl", function($scope, Movie) {
$scope.test = function () {
Movie.query();
return 42;
}
});
And my template file :
<div ng-app="app">
<div ng-controller="MovieCtrl">
{{ test() }}
</div>
</div>
As expected the template is rendered and '42' is properly displayed, but if I watch the console in the Chrome developer tools I keep seeing the following error (also as expected):
GET http://localhost/movie 404 (Not Found)
But this message is printed indefinitely and never stops, as if my Movie resource keeps trying to reach /movie even though after a hundred tries it still keeps failing.
Thank you in advance.