AngularJS is a client-side JavaScript MVC framework that extends HTML with new attributes and custom tags. It allows developers to create reusable components with modularity, dependency injection, two-way data binding, and testing. Key concepts include expressions, filters, directives, models, modules, controllers, services, and templates. Modules allow building reusable components like controllers, services, filters and directives. Controllers set up initial scope state and behavior while services extract reusable code and enable communication between controllers. Two-way data binding synchronizes models and views.
3. Agenda
● What is AngularJS?
● Why use AngularJS?
● Concepts + demos
● Tips
4. What is angular?
● AngularJS IS NOT
- a Library
- a replacement for HTML, CSS or JS
● AngularJS IS
- a clientside JavaScript MVC Framework
- Extention to HTML with new attributes,
custom tags, ..
13. Expressions
• JavaScript-like code snippets that are
usually placed in bindings
- {{ expression }}
• Valid expressions
- {{ 1 + 1 }}
- {{ a + b }}
- {{ name }}
16. Modules
● AngularJS has nothing like a main method
● Container for custom components
● Allows us to build re-usable components
- Controllers
- Services
- Filters
- Directives
17. Controllers
• Set up the inital state of $scope object
• Add behavior to the $scope object
• Inheritance
18. Controllers
• Creates a new child scope
• Scope of view injected in Controllers constructor
function
26. Modules
• An application level module
• A module for each Feature
• A module for each reusable component
- Controllers
- Services
- Filters
- Directives
27. Controllers
• Do not use controllers to:
- Manipulate DOM ( à use directives)
- Format input (à use forms)
- Share code or state across Controllers
(à use services)
28. Dependencies
• What happens with Minification?
- Renames function parameters
- How do does compiler know which is which?