Bonus points for Sander: his entire presentation was made with AngularJS :-) His presentation is a basic explanation of AngularJS.
In AngularJs, you define variables and you can bind to them in templates, where the value of the variable automatically shows up. One way to define variables is to initialize them in your controller, another way is to define them as a “model” in your template, for instance turn an input field into a model.
Note: there’ll be a new syntax for scopes in AngularJS:
controller as. The current approach seems to confuse a lot of
people. The new approach is not really different, it is just the
syntax that’s different.
The new syntax looks like
ng-controller="SomeScope as myData". The
good thing about this is that you’re explicitly giving your scope a
name, which makes it easier to deal with nested scopes: you can refer
to variables in parent scopes. In the old way you’d have implicit
inheriting of values from the parent scopes. (Personal note: the old
way sounds a bit like the old Zope2’s “Acquisition” mechanism).
The new syntax is easier to read and maintain.
Dependency injection is pretty central to AngularJS. One way is to use services. You can request a service in your scope and define the actual service elsewhere. So you can swap out implementations, as long as something is available under the same service name.
Another nice option you have in AngularJS: custom directives. Which
means custom HTML tags like
<todoitem>. You define those in your
actions on the directive; etcetera.
A comment by Sander on one of the questions: “AngularJS is the first framework that lets me write less code, that’s the good thing about AngularJS”.
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):