HTML and CSS Reference
In-Depth Information
}
});
}
});
The next step in your code would be a call to App.people.save() to persist the data.
Angular
A nice framework developed by Googlers Angular.js , has some very interesting design
choices, most namely Dependency Injection (or IOC) for JavaScript. Dependency In‐
jection makes your code easier to test and pushes object creation and wiring as high up
in the application as possible, which gives you one central location for the flow of logic.
Angular is well thought out with respect to template scoping and controller design. It
supports a rich UI-binding syntax to make operations like filtering and transforming
values easy. On github, Angular is a heavily watched project and has a healthy commu‐
nity contributing to it ( Figure 4-13 ).
Figure 4-13. Angular github stats, June 2012
For a RESTful demo written with Node.js to demonstrate Angular's
server synchronization capabilities, see https://github.com/html5e/
angular-phonecat-mongodb-rest .
Angular server synchronization. The Angular model is referenced from properties on
Angular scope objects. The data in your model could be JavaScript objects, arrays, or
primitives; it doesn't matter. What matters is that these are all referenced by the scope
object. Angular employs scopes to keep your data model and your UI in sync. Whenever
something occurs to change the state of the model, Angular immediately reflects that
change in the UI and vice versa.
When building web applications, your design needs to consider security
threats from JSON vulnerability and XSRF. Both the server and client
must cooperate to eliminate these threats. Angular comes preconfig‐
ured with strategies that address these issues, but for this to work, back‐
end server cooperation is required.
 
Search WWH ::




Custom Search