Can someone help a newbie? I’ve tried node app.js and node services.js and I get ReferenceError: angular is not defined. I guess this is so obvious it’s not covered in the tutorial. Help a guy out.
Thanks for responding. I mis-typed there. The Creating a CRUD App in Minutes with Angular’s $resource tutorial is the one I’m talking about. I did the API part first and I got it up and running as described in the tutorial. I deployed that with node bin/www.
I have all the files in the file structure described. But I’m not sure what is meant by ‘Assuming the app is deployed under localhost/movieApp’. I know this must be something very simple that I’m overlooking. I would really appreciate the obvious being pointed out. I’m bewildered.
Not sure what is meant by ‘Assuming the app is deployed under localhost/movieApp’.
Can someone help a newbie? I’ve tried node app.js and node services.js and I get ReferenceError: angular is not defined. I guess this is so obvious it’s not covered in the tutorial. Help a guy out.
I just very briefly skimmed through the article, but this would assume some kind of server running on your localhost (e.g. a node server) for development purposes. As mentioned in the article, $resource expects a RESTful API, which you would then query like e.g. http://localhost/api/entries.
This means that Angular is not loaded, or in node-terms, hasn’t been required properly. However, running an Angular-app with node doesn’t make much sense anyway – it’s meant to run in the browser. I’d suspect it even depends on that (e.g. a node environment doesn’t have the window object or document).
Edit: Yup, throws a ReferenceError: window is not defined
The index file is missing things that are in the online working version. I guess I have to build the html up with angular directives . But I thought this was supposed to work out of the box.
Thanks for responding. Any thoughts are very welcome.
In the meantime, I’ve pinged the author of the article on one of Sitepoints private communication sites. Hopefully he gets it and can join this discussion to help you out!
If not, I’ll try to follow those articles this weekend and see if I run into the same problems you are hitting.
I’m glad that you’ve managed to fix the problem. Would you mind replying to your message in the article comments with your solution? It might be useful to others, and it will let them know that it wasn’t an error with the tutorial.