многоязычная компиляция angular7 l10n - PullRequest
0 голосов
/ 09 марта 2019

я следовал этой статье, чтобы реализовать многоязычность с "aot" (лучшая производительность) https://angular -templates.io / tutorials / about / angular-internationalization-i18n-multi-language-app

но при попытке запустить CXR-WebViews: build: production-ru я получаю ошибки компиляции.если я использую ng serve, он все равно компилируется без ошибок.

  1. error:

    10% сборка 4/4 модулей 0 activeWarning: Не удается разрешить все параметры для ProductGroupEx вC: /cxr/CXR-WebViews/src/app/dbModels/ProductGroupEx.ts: (?).Это станет ошибкой в ​​Angular v6.x. Предупреждение: невозможно разрешить все параметры для ProductEx в C: /cxr/CXR-WebViews/src/app/dbModels/ProductEx.ts: (?).Это станет ошибкой в ​​Angular v6.x. Предупреждение: невозможно разрешить все параметры для VatEx в C: /cxr/CXR-WebViews/src/app/dbModels/VatEx.ts: (?).Это станет ошибкой в ​​Angular v6.x

  2. error:

    ОШИБКА в src \ app \ fields \ trading-zone \ enterprise.component.ts.EnterpriseDrop.html (1,12):: свойство 'data' защищено и доступно только в пределах класса DropDownComponent и его подклассов.src \ app \ fields \ trading-zone \ enterprise.component.ts.EnterpriseDrop.html (1,44):: Свойство 'model2' защищено и доступно только в пределах класса 'DropDownComponent' и его подклассов.src \ app \ fields \ trading-zone \ enterprise.component.ts.EnterpriseDrop.html (1,44):: Свойство 'model2' защищено и доступно только в пределах класса 'DropDownComponent' и его подклассов.src \ app \ fields \ trading-zone \ region.component.ts.RegionDrop.html (1,12):: Свойство 'data' защищено и доступно только в пределах класса DropDownComponent и его подклассов.src \ app \ fields \ trading-zone \ region.component.ts.RegionDrop.html (1,44):: свойство 'model2' защищено и доступно только в пределах класса DropDownComponent и его подклассов.

как-то не расширяет классовую корректность.Почему это?он не думает, что мне нужно публиковать все остальные классы, потому что это ошибка компиляции.

angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "CXR-WebViews": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
          "style": "sass"
        }
      },
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/CXR-WebViews",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/@ng-select/ng-select/scss/default.theme.scss",
              "src/styles.scss"
            ],
            "scripts": [],
            "es5BrowserSupport": true
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            },
            "production-en": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "outputPath": "dist/CXR-WebViews/en/",
              "baseHref": "/en/",
              "i18nFile": "src/assets/locale/en.lproj/tables.xlf",
              "i18nFormat": "xlf",
              "i18nLocale": "en",
              "i18nMissingTranslation": "error",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            },
            "production-de": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "outputPath": "dist/CXR-WebViews/de/",
              "baseHref": "/de/",
              "i18nFile": "src/assets/locale/de.lproj/tables.xlf",
              "i18nFormat": "xlf",
              "i18nLocale": "de",
              "i18nMissingTranslation": "error",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            },
            "production-fr": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "outputPath": "dist/CXR-WebViews/fr/",
              "baseHref": "/it/",
              "i18nFile": "src/assets/locale/fr.lproj/tables.xlf",
              "i18nFormat": "xlf",
              "i18nLocale": "it",
              "i18nMissingTranslation": "error",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            },
            "production-it": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "outputPath": "dist/CXR-WebViews/it/",
              "baseHref": "/it/",
              "i18nFile": "src/assets/locale/it.lproj/tables.xlf",
              "i18nFormat": "xlf",
              "i18nLocale": "it",
              "i18nMissingTranslation": "error",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "CXR-WebViews:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "CXR-WebViews:build:production"
            },
            "en": {
              "browserTarget": "CXR-WebViews:build:production-en"
            },
            "de": {
              "browserTarget": "CXR-WebViews:build:production-de"
            },
            "fr": {
              "browserTarget": "CXR-WebViews:build:production-fr"
            },
            "it": {
              "browserTarget": "CXR-WebViews:build:production-it"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "CXR-WebViews:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "karmaConfig": "src/karma.conf.js",
            "styles": [
              "src/styles.scss"
            ],
            "scripts": [],
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    },
    "CXR-WebViews-e2e": {
      "root": "e2e/",
      "projectType": "application",
      "prefix": "",
      "architect": {
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "CXR-WebViews:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "CXR-WebViews:serve:production"
            }
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": "e2e/tsconfig.e2e.json",
            "exclude": [
              "**/node_modules/**"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "CXR-WebViews"
}
...