Gemini Code Execution
12:11
14 күн бұрын
Create RxJS custom operators
15:45
Rewrite countdown timer - Part 4
15:24
Rewrite countdown timer - Part 3
32:19
Rewrite countdown timer - Part 2
15:12
Пікірлер
@walterzielenski3637
@walterzielenski3637 2 ай бұрын
Connie - I just discovered your playlist and I am working my way through the videos by coding along with you. I cannot believe that you have gone undiscovered for so long - so many great examples and coding techniques, showing how to use RxJS to power a simple app by showing developers how to use angular best practices. I have 1 question for you - would there be a performance hit by re-creating the injector each time the pokemon object changes? I get how to do it now that you have shown how, but I am worried that the performance hit might be severe compared to just using an @Input - in other words, maybe there are times you should use the technique that you are demonstrating and then there are times that you should not.
@connieleung96
@connieleung96 2 ай бұрын
Thanks for the nice comment. Can you tell me which line with the inject? Thanks.
@walterzielenski3637
@walterzielenski3637 2 ай бұрын
@@connieleung96 export class PokemonStatsComponent { @Input() pokemon!: FlattenPokemon; vs pokemon = inject(POKEMON_TOKEN); } The inject approach requires re-instantiating myInjector in PokemonTabComponent, which you coded like this: ngOnChanges(changes: SimpleChanges): void { this.myInjector = this.createInjector(changes['pokemon'].currentValue); } And I feel that re-instantiating myInject each time the pokemon changes would have worse performance than using the simpler @Input. After a pokemon change, I believe both approaches would introduce a change detection cycle, but the inject approach has the added overhead of re-instantiating the injector.
@aram5642
@aram5642 5 ай бұрын
Today you don't need to use cdref anymore, you have setInput method on the component ref
@connieleung96
@connieleung96 4 ай бұрын
thanks.
@gagansuneja4277
@gagansuneja4277 6 ай бұрын
Hi Connie I am currenly facing issue with this pattern I am using viewContainerRef.createcomponent and then using viewContainerRef.insert to attach them to views, issue is that even after saving destroying them using destroy method and also after clearing the container using viewContainerRef.clear they somehow still show up in edge's detached html view.., would be great if you can give some spotlight on this. Thanks