This past week at work, I have been working in the Angular part of the project and understanding how the scopes of Parent/children work help to manage shipping code that works and that its clean and tested (We work use TDD- Test Driven Development).
Key concepts to understand:
- Variables defined on the parent’s scope are copied to the child’s scope.
- If the child gets a property with the same name as the parent’s then the child scope hides/shadows the parent property of the same name.
- The parent scope is directly accessible by the children scope so children can modify it but the parent can not access to it’s children’s scope
Useful Links: Here I wanted to share some links that were useful and really easy to understand:
https://rclayton.silvrback.com/parent-child-controller-communication
https://github.com/angular/angular.js/wiki/Understanding-Scopes