Directives
The Secret Sauce
- Directives let you write new DOM elements or attributes
- With directives you can get two-way data binding
- Directives can be used for setting attribute values or inserting templates
- Makes markup more semantic
Data Binding
- Allows for instant update of UI based on events
- Data models are just JSON objects
- Allows for complex business logic without much effort
- Operates bi-directionally to keep things in sync
Filters
- Useful for cleaning up data to be presented in UI
- Can be used for sorting collections
- Just javascript functions so they are extremely flexible
Services
- Used as the interface for external data
- $resource api makes RESTful interaction simple
- Easy to use promises for painless async operations
- Can provide data from an API or even just a JSON object
Controller
- Just a javascript function
- Dependencies are injected by Angular
- $watch functions are very powerful
- Binds the app together
- Avoid DOM manipulation for easier testing
Flexible Use Case
- Great for single page applications
- Can be bound to any segment of the DOM
- Can have a simple app contained within a div
Made with Slides.com