fix(core): add CLI instructions when localize polyfill is missing (#33199)

PR Close #33199
This commit is contained in:
vikerman 2019-10-16 11:58:25 -07:00 committed by Matias Niemelä
parent de445709d4
commit 5dfbcd5631
3 changed files with 4 additions and 3 deletions

View File

@ -13,5 +13,5 @@ const __global = "undefined" !== typeof global && global;
const _global = __globalThis || __global || __window || __self;
if (ngDevMode) _global.$localize = _global.$localize || function() {
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please add `import '@angular/localize/init';` to your polyfills.ts file.");
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your polyfills.ts file)");
};

View File

@ -15,5 +15,5 @@ var __global = "undefined" !== typeof global && global;
var _global = __globalThis || __global || __window || __self;
if (ngDevMode) _global.$localize = _global.$localize || function() {
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please add `import '@angular/localize/init';` to your polyfills.ts file.");
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your polyfills.ts file)");
};

View File

@ -47,6 +47,7 @@ if (ngDevMode) {
throw new Error(
'It looks like your application or one of its dependencies is using i18n.\n' +
'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' +
'Please add `import \'@angular/localize/init\';` to your polyfills.ts file.');
'Please run `ng add @angular/localize` from the Angular CLI.\n' +
'(For non-CLI projects, add `import \'@angular/localize/init\';` to your polyfills.ts file)');
};
}