fix(ivy): prevent templateOverrides from causing infinite loop (#29402)
fix(ivy): prevent templateOverrides from causing infinite loop (#29402)

Previously, the transitive scope calculation could lead into re-compiling
the same module multiple times. This fix ensures we cannot get into this loop.
It should be fixed more completely (e.g. more cases) once FW-1178 is resolved.

PR Close #29402

angular/angular,sarunint/angular,Toxicable/angular,blesh/angular,petebacondarwin/angular,IgorMinar/angular,ocombe/angular,brandonroberts/angular,IdeaBlade/angular,gdi2290/angular,Toxicable/angular,manekinekko/angular,mlaval/angular,vikerman/angular,ocombe/angular,juristr/angular,juristr/angular,sarunint/angular,wKoza/angular,Brocco/angular,jasonaden/angular,gdi2290/angular,brandonroberts/angular,mlaval/angular,vikerman/angular,sarunint/angular,snaptech/angular,IgorMinar/angular,matsko/angular,StephenFluin/angular,JiaLiPassion/angular,Toxicable/angular,brandonroberts/angular,alexeagle/angular,alxhub/angular,petebacondarwin/angular,angular-indonesia/angular,juristr/angular,brandonroberts/angular,angular/angular,snaptech/angular,angular-indonesia/angular,IgorMinar/angular,IdeaBlade/angular,blesh/angular,mlaval/angular,snaptech/angular,mhevery/angular,IdeaBlade/angular,JiaLiPassion/angular,manekinekko/angular,mgechev/angular,IdeaBlade/angular,mgechev/angular,mprobst/angular,brandonroberts/angular,jasonaden/angular,shairez/angular,IgorMinar/angular,mprobst/angular,ocombe/angular,Brocco/angular,alexeagle/angular,snaptech/angular,mhevery/angular,filipesilva/angular,vikerman/angular,StephenFluin/angular,Toxicable/angular,wKoza/angular,gkalpak/angular,filipesilva/angular,filipesilva/angular,juristr/angular,IdeaBlade/angular,alxhub/angular,alexeagle/angular,jasonaden/angular,juristr/angular,alxhub/angular,mprobst/angular,mprobst/angular,gkalpak/angular,Brocco/angular,gnomeontherun/angular,sarunint/angular,angular-indonesia/angular,snaptech/angular,Brocco/angular,Toxicable/angular,alexeagle/angular,wKoza/angular,Brocco/angular,gdi2290/angular,wKoza/angular,shairez/angular,gnomeontherun/angular,StephenFluin/angular,vikerman/angular,wKoza/angular,mlaval/angular,sarunint/angular,vikerman/angular,blesh/angular,JiaLiPassion/angular,ocombe/angular,mhevery/angular,vikerman/angular,petebacondarwin/angular,mhevery/angular,IgorMinar/angular,matsko/angular,blesh/angular,gnomeontherun/angular,gkalpak/angular,StephenFluin/angular,Brocco/angular,sarunint/angular,shairez/angular,alexeagle/angular,gkalpak/angular,alxhub/angular,manekinekko/angular,StephenFluin/angular,mhevery/angular,petebacondarwin/angular,Toxicable/angular,ocombe/angular,manekinekko/angular,angular-indonesia/angular,filipesilva/angular,jasonaden/angular,mprobst/angular,manekinekko/angular,gnomeontherun/angular,petebacondarwin/angular,blesh/angular,brandonroberts/angular,alxhub/angular,IgorMinar/angular,mhevery/angular,jasonaden/angular,jasonaden/angular,wKoza/angular,matsko/angular,shairez/angular,angular/angular,snaptech/angular,gdi2290/angular,mlaval/angular,shairez/angular,matsko/angular,mgechev/angular,gdi2290/angular,JiaLiPassion/angular,mgechev/angular,mprobst/angular,petebacondarwin/angular,ocombe/angular,angular/angular,gdi2290/angular,manekinekko/angular,filipesilva/angular,juristr/angular,matsko/angular,alexeagle/angular,mgechev/angular