Closed Patrick-Clausen closed 1 year ago
The untilDestroyed function seems to use the global variable ngDevMode to specify whether it should add a bit of extra debug information.
The implementation of this assumes that ngDevMode is defined, and is either truthy or falsy. However, according to Angular's implementation, it can actually be truthy, falsy or undefined: https://github.com/angular/angular/blob/main/packages/core/src/util/ng_dev_mode.ts#L24
In some specific setups of Angular applications, this means that any component using the untilDestroyed method can't be instantiated.
Suggest doing a more resilient check, like Angular do themselves: https://github.com/angular/angular/blob/main/packages/core/src/util/ng_dev_mode.ts#L118
Or simply relying on angular's own isDevMode() method, which does the same thing.
Fixed in 9.2.3.
Impressive turn-around, thanks a lot!
The untilDestroyed function seems to use the global variable ngDevMode to specify whether it should add a bit of extra debug information.
The implementation of this assumes that ngDevMode is defined, and is either truthy or falsy. However, according to Angular's implementation, it can actually be truthy, falsy or undefined: https://github.com/angular/angular/blob/main/packages/core/src/util/ng_dev_mode.ts#L24
In some specific setups of Angular applications, this means that any component using the untilDestroyed method can't be instantiated.
Suggest doing a more resilient check, like Angular do themselves: https://github.com/angular/angular/blob/main/packages/core/src/util/ng_dev_mode.ts#L118
Or simply relying on angular's own isDevMode() method, which does the same thing.