thinkster-django-angular-tutorial
thinkster-django-angular-tutorial copied to clipboard
various clarifications & corrections
Over this weekend and last, I went through the Django+Angular tutorial carefully. When found something in the notes that needed to be corrected or clarified, I made changes locally. Hopefully others can benefit from the effort.
Thanks for a well-written tutorial. It has helped me understand Angular (which I will need for work), and also Django (which I've been wanting to play with at home).
Alan
One comment I had (that I did NOT include in this pull request), was that there are several places in the Angular code where the same word is used for multiple things: (1) service name, namespace function, internal variable names or (2) object properties and member functions. I found these confusing, and so I changed the names to be close, but not exact, to clarify which ones had to match vs which ones didn't.
For example, I changed "factory('Snackbar', Snackbar)" to "factory('svcSnackbar', nsSnackbar)" And I changed the object from "var Snackbar = { error: error, show: show };" to "var ivarSnackbar = { error: do_error, show: do_show };". This forced me to learn the MEANING of the first and second arguments to the factory() command, rather than just seeing the same words repeated a few times.
In general, if I see a function or a structure that seems to map two things together, I try to make sure they have different names so I can distinguish the things that are being mapped.
I will not put those changed into this pull request, because I am pretty sure that I chose lousy and misleading names for my alterations (svc, ivar, do_, etc). But I wanted to share the concept, since this is a tutorial aimed at folks who don't have much experience with Angular.