My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Replacing $scope.$watch with Lifecycle Hooks - codelord.net

Aviv Ben-Yosef's photo
Aviv Ben-Yosef
·Dec 13, 2016

Angular 1.5's components and directives have awesome lifecycle hooks that allow us to get rid of $scope.$watch in many cases. This makes code cleaner, faster and upgrade-ready.

Let's see step-by-step how to do it.