Angular · Senior · Question 13 of 75
When might you use ChangeDetectorRef.detach()?
- ✓Correct answer: For a widget receiving very frequent data, where you call
detectChanges()manually at a controlled rate - 2To delete a component from the DOM
- 3To disable inputs of a component
Explanation
A detached view is skipped by change detection until it is reattach()ed or checked manually. It is a sharp tool: forgetting to update leaves the UI stale.