Assures that the method is called outside of the Angular Zone, otherwise throws an error.
()
| 211 | Assures that the method is called outside of the Angular Zone, otherwise throws an error. |
| 212 | */ |
| 213 | static assertNotInAngularZone(): void { |
| 214 | if (NgZone.isInAngularZone()) { |
| 215 | throw new RuntimeError( |
| 216 | RuntimeErrorCode.UNEXPECTED_ZONE_STATE, |
| 217 | ngDevMode && 'Expected to not be in Angular Zone, but it is!', |
| 218 | ); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Executes the `fn` function synchronously within the Angular zone and returns value returned by |
no test coverage detected