Live data from Hacker News

Everything you need to understand to start with AngularJS

stephanebegaudeau.tumblr.com

11–20 of 31 posts

Re: Everything you need to understand to start with AngularJS

#12
This guide is nice as it provides a short introduction into Angular's features.

I would kindly recommend you to read the Conceptual Overview section of the AngularJS Developer Guide (http://docs.angularjs.org/guide/concepts). This covers the heart of the framework and also parts of its philosophy. If you want to understand WHY AngularJS works the way it does not only WHAT it does then this page will really help you. You will also understand why this is a masterpiece of engineering.

Re: Everything you need to understand to start with AngularJS

#13
post #8

And to learn more, go here http://egghead.io

These are hands-down the best AngularJS tutorials on the web. I've read and watched every AngularJS tutorial I can find on the web and nothing compares to the clarity and gentle introductions these videos provide.

I value gentle introductions greatly. They require a special kind of pedagogy.

Re: Everything you need to understand to start with AngularJS

#15
post #14

If using with Django, is it possible to change the {{}} to something else?

I don't know if it's possible but, in general, it's not a good idea to mix server-side and client-side templating. The Angular guys discuss this in one of the videos on the Angular channel (I found it for you here: http://www.youtube.com/watch?feature=player_detailpage&v...). The two reasons seem to be first, it's not clean and second, it's easy to introduce security issues.

If I want to have a page that has both server-side templating and client-side templating, I push the ng-app directive down into the DOM and assert that Angular has "ownership" of that portion of the page. I can't remember what Django's templating engine supports, but in Jinja2, you can create a {% raw %} {% endraw %} block that tells Jinja2 not to parse any delimiters in the block (I'm sure Django has something like this, I just can't recall what it is). This makes it pretty easy to separate out Angular's purview from the server's purview even on a single page.

Re: Everything you need to understand to start with AngularJS

#18
post #14

If using with Django, is it possible to change the {{}} to something else?

I don't know if it's possible but, in general, it's not a good idea to mix server-side and client-side templating. The Angular guys discuss this in one of the videos on the Angular channel (I found it for you here: http://www.youtube.com/watch?feature=player_detailpage&v... ). The two reasons seem to be first, it's not clean and second, it's easy to introduce security issues. If I want to have a page that has both se…

Django 1.5 introduced {% verbatim %} {% endverbatim %} which takes care of what you describe. https://docs.djangoproject.com/en/dev/ref/templates/builtins...

Re: Everything you need to understand to start with AngularJS

#19
post #14

If using with Django, is it possible to change the {{}} to something else?

Yes, in your Angular app's config you can use the $interpolateProvider to adjust this. For example, to use [[ ]], just do this:

    var myApp = angular.module('myApp', [], function($interpolateProvider) {
        $interpolateProvider.startSymbol("[[");
        $interpolateProvider.endSymbol("]]");
    });

Re: Everything you need to understand to start with AngularJS

#20

nice tutorial! it probably would have saved me lots of time, but now that I went through too many of them, this is more like a good recap :-) what I am missing though (not a critic to your tutorial, just expressing my frustration as I try to learn beyond the basics) is concrete examples of how to implement specific features: authentication w/ express, nontrivial restful interaction, and interaction with Socket.IO. Mo…

Finding the same thing with node.js, I got started OK with passport thanks to the examples for passport-local: https://github.com/jaredhanson/passport-local/tree/master/ex..., especially express3-mongoose-multiple-files.

Beyond that though, I've had to hack a fair bit to get "remember me" working (following the practices suggested http://stackoverflow.com/questions/549/the-definitive-guide-... and http://fishbowl.pastiche.org/2004/01/19/persistent_login_coo...) so not exactly straight-forward. (Aside: the remember me example for passport local might not be production ready, see http://stackoverflow.com/questions/16136712/is-an-authtoken-...).

Also would love to hear what others are using!

Post reply on HN