components: ngZone: 'noop' option doesn't work with Angular Material components
Bug, feature request, or proposal:
What is the expected behavior?
Buttons, sidenav, selects, input fields, etc. should function normally when ngZone: ‘noop’ is specified.
What is the current behavior?
If you enabled ngZone: ‘noop’ most Angular Material components break.
What are the steps to reproduce?
Launching a an app which uses material components using .bootstrapModule(AppModule, {ngZone: 'noop'});
results in components that do not work properly.
What is the use-case or motivation for changing an existing behavior?
Angular added in ‘noop’ so that apps that control their own change detection using OnPush can disable the extra overhead of zones. Is the material team planning to support this?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.0, Material 5.0
Is there anything else we should know?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 61
- Comments: 27 (7 by maintainers)
ngrx and rx-angular give us a way to create application without zonejs. I wish that material remove zonejs so I can get rid of this library in my application. this is only thing is missing.
@jelbourn its 2022, any news? it’s in the plan of the team?
I’m going to close this as complete now thanks to the work done by @mmalerba to remove
ngZone.onStable
andngZone.onMicrotaskEmpty
. Note that if you are usingngZone: 'noop'
, you do need to run change detection throughApplicationRef.tick
.News here?
Any update on this?
Angular material and cdk will both adopt signals when support is further along. It’s a long-term goal for the team to ensure that all of Angular’s first-party offerings are signal-based with no zonejs dependency. It’s a long road, though, as it involves many breaking changes that need gradual rollouts, backwards compatibility, and migration tooling.
I’d also love to get an update on this one. I really like using materials but now it seems that it’s a no-go when high performance is a must and noop is used 😕
Any Update?
The lack of transparency about whether Material will go Signals in the foreseeable future makes me believe that we get stuck with it as it is and zone.js will still be needed in the coming years. My context is that I want Angular to transpile to native async/await - which is seemingly not possible if zone.js is still in the game.
Any news on this matter? “In Angular 17, signals were released as stable (except for the effect() function)”. Can we at least expect material to move forward in the foreseeable future (months not years)? Would be great to have some updated info in order to make decisions on our side.
I wrote this library to help with angular zoneless apps.
The library will also make material work in zoneless mode (and will also make every 3rd party that does not support zoneless work) link to the library: az-zoneless. The library also expose events that will trigger
ChangeDetectorRef.detectChanges
.For example:
Any updates on this?
Another note. if you happen to use angular lifecycle hooks. Make sure you manually call ngOninit… Just spent ages with a dev fixing his code to finally notice he used lifecycle
For this repository, the compatibility is just there. There’s nothing to enable or disable so there’s not really a “status” so to speak.
@chrisguttandin to use positionStrategy without zone if you call “updatePosition” after attaching it works fine
Hello?