Skip to content

Commit 7b3d269

Browse files
alan-agius4dylhunn
authored andcommitted
refactor(core): modernize $localize checks (angular#52368)
Use nullish coalescing. PR Close angular#52368
1 parent d775fa1 commit 7b3d269

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
5050
// This helper is to give a reasonable error message to people upgrading to v9 that have not yet
5151
// installed `@angular/localize` in their app.
5252
// tslint:disable-next-line: no-toplevel-property-access
53-
global.$localize = global.$localize || function() {
53+
global.$localize ??= function() {
5454
throw new Error(
5555
'It looks like your application or one of its dependencies is using i18n.\n' +
5656
'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' +

0 commit comments

Comments
 (0)