AngularJS Custom components
Topics
- What and Why Components?
- Simple component
- Passing external data to component
What is and Why Component?
Template and Controller
- In a typical Angular application, a controller and a template work together to create a dynamic view
- The template (the part of the view containing the bindings and presentation logic) acts as a blueprint for how our data should be organized and presented to the user
- The controller provides the context in which the bindings are evaluated and applies behavior and logic to our template
Issues of Using Template and Controller
- What if we want to reuse the same functionality in a different part of our application ?
- We would need to duplicate the template and controller - this is errorprone and hurts maintainability.
- The scope, that glues our controller and template together into a dynamic view, is not isolated from other parts of the page
- What this means is that a random, unrelated change in a different part of the page (e.g. a property-name conflict) could have unexpected and hard-to-debug side effects on our view.
You must have an active subscription to download PDF,Lab Zip and Recordings of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.