Tag Archives: angular
Why unsubscribe in Angular?
Why do you need to unsubscribe of observables in OnDestroy hook? Observable can emit multiple values, so if you want to stop evaluating logic after destroying (closing) component you would need to call unsubscribe If component is closed and request is still pending the unneeded logic could evaluate after component is closed And sometimes it […]
Automatically add stub files using Angular schematics
There is no shallow testing in our loved Angular. So, to test only your component without rendering children, you would need to use stub components in your TestBed. If you are bored to create stub components manually, this article is for you. We will use Angular/Schematics for this. [updated] Please install schematics-cli beforehand and make […]