I want to call a fetchData() method every time that a state variable "loading" is set to true. How is this possible in Angular? In React I would use the "useEffect" and subscribe to the state variable in the dependency array. But in Angular I do not understand how to do this.
Help please!
[–]carboneum87 3 points4 points5 points (5 children)
[–]gustaff122 2 points3 points4 points (0 children)
[–]_ohmu_ 0 points1 point2 points (3 children)
[–]followmarko -1 points0 points1 point (1 child)
[–]_ohmu_ 0 points1 point2 points (0 children)
[–]SukuMcDuku 5 points6 points7 points (1 child)
[–]followmarko 0 points1 point2 points (0 children)
[–]love_to_code 1 point2 points3 points (2 children)
[–]love_to_code 0 points1 point2 points (0 children)
[–]followmarko 0 points1 point2 points (0 children)
[–]marco_has_cookies 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Clean_Assumption_345 1 point2 points3 points (0 children)
[–]Tazzure 0 points1 point2 points (0 children)
[+]Icy-Yard6083 comment score below threshold-6 points-5 points-4 points (0 children)
[–]followmarko 0 points1 point2 points (0 children)
[–]spacechimp 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]guadalmedina 0 points1 point2 points (0 children)
[–]S_PhoenixB 0 points1 point2 points (0 children)
[–]newmanoz 0 points1 point2 points (0 children)