Comments (7)
Why doesn't afterNextRender work here?
afterNextRender
did not support updating state until 432afd1 which just missed the release this week
That being said, this can be solved by using OnPush which will run local change detection and prevent NG0100.
OnPush
doesn't prevent NG0100 other than the fact that NG0100 is broken and can't detect errors in OnPush
components. Using signals to prevent NG0100 works the same in default and OnPush
components.
from angular.
This is a ECAIHBC situation. Signals don't currently affect how change detection is handled, it's only a reactive envelope around a value at the moment. If that value has already been read in a template before its value is being updated during the same change detection cycle (in ngOnInit
) then the previously checked template becomes out-of-date, violating Angular's top-down data flow requirements.
The details of how this works with signals may change in the future, but as of right now this is working as designed.
from angular.
That being said, this can be solved by using OnPush which will run local change detection and prevent NG0100.
from angular.
Ouch, hello, guys, and thanks for your answers.
I've sent poor @ValentinBossi over from the NgRx repo and promised him you know of some Signal-based solution/alternative that already prevents the NG0100.
Why doesn't afterNextRender
work here? I understood it as a "better" version of Promise.resolve(() => ....)
. Unfortunately, it also triggers NG0100.
from angular.
@atscott, thanks for the clarification!
from angular.
I'm also going to close this as fixed by 432afd1. That PR addressed the issue where updating a signal that's read in another view attached to ApplicationRef
would not work and still cause NG0100
.
from angular.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.
from angular.
Related Issues (20)
- "ng test" : Unhandled promise rejection: Error: Injector has already been destroyed. HOT 1
- Template parser produces inaccurate source spans when `preserveWhitespaces` is false or omitted HOT 3
- Async SVG files could not be loaded when the zone.js is present as peer dependency HOT 2
- Angular SSG: Incompatibility between withXsrfConfiguration( ) (HttpClient) & Relative Paths in SSG HOT 2
- Angulars Service Worker - "beforePushNotification" HOT 1
- input signal effects are not run when attaching a directive to an IonButton HOT 3
- Mejorar uso de Pipes HOT 1
- Computed signals and Effects should produce runtime warning if dependencies reaches zero HOT 1
- Dead area for scrolling: Column for right hand menu HOT 1
- More user testing of angular.io HOT 4
- URL containing space fails to be fetched during prerender phase HOT 1
- Help me - could not resolve module angular/node_modules/mermaid/dist/mermaid.js HOT 4
- angular tutorial image file missing HOT 1
- dispatchEvent won't call FormGroup.valueChanges in test HOT 4
- Add signals reflecting state of the AbstractControl HOT 3
- Add WritableComputed to allow computed with write operations HOT 5
- Error Message for missing [ngModelOptions]="{standalone: true}" entry dont show line in code where it is missing
- signal(Observable<T>) to signal<T>() operator HOT 5
- I smell a rat, stop ruining angular HOT 4
- Hydration doesn't work for ng-templates that are defined inside of another component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.