Quick Introduction to AngularJS
HTML & JavaScript
for web-apps
rather than documents
Vojta Jína
vojta@google.com
- JavaScript Magic for building Web Apps
- MVC Framework + HTML Compiler
- Open Source (GitHub, MIT)
- Google Funded
===script===
$(function() {
var name = $('#name3');
var greeting = $('#greeting3');
function update() {
greeting.text('Hello ' + name.val() + '!');
}
update();
name.bind('keydown', function() {
setTimeout(update, 0);
});
});
===/script===
Hello {{firstName}}!
So you say jQuery sucks ?
No, we love jQuery, for DOM manipulation !
"... simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development."
Two-way data binding...
To test, you need...
1) Environment
2) Testable code
Unit + E2E test environment baked in !
- JasmineJS
- JsTestDriver
- Mocks
- Continuous Integration
Is easy with AngularJS:
- Strict separation of view / logic
- Dependency Injection
- No global state
- Increases the level of abstraction.
- Helps to write less code.
- Makes your app testable.
- Works well together with other libs.
- Helps to design and maintain big apps.