Closed
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Effects won't execute if created in a component that is detached from a change detection tree, example:
export class CDDetatched {
constructor(cdRef: ChangeDetectorRef) {
cdRef.detach();
}
e = effect(() => console.log('An effect in a detached component'));
}
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-7zd1fv?file=src%2Fmain.tsFmain.ts
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in (run ng version
)
No response
Anything else?
Created from #55644