angular4应用程序无法在智能电视的Web浏览器中运行(WebOSBrowser)

时间:2017-08-07 04:57:35

标签: angular command-line-interface lg smart-tv

我尝试在服务器中部署我的angular4应用程序,并在桌面浏览器和移动浏览器中正常工作。现在我想从智能电视浏览应用程序,但它显示的是空白页而不是应用程序,可能是在智能电视上浏览我的应用程序的实际问题?     如果我需要添加任何依赖项,尤其是智能电视(WebOS浏览器),请各位帮帮我。

Angular CLi Project ::(。angular-cli.json)

`{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "project_name"
  },
  "apps": [`enter code here`
    {
      "root": "src",
      "outDir": "./../WebContent",
      "assets": [
        "assets",
        "rieterFavicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "styles.css"
      ],
      "scripts": [
      "../node_modules/chart.js/dist/Chart.js",
      "app/resources/js/jquery-3.2.1.js",
      "app/resources/js/theme-switch.js"
      ],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json"
    },
    {
      "project": "src/tsconfig.spec.json"
    },
    {
      "project": "e2e/tsconfig.e2e.json"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}`

pcakage.json

{ "name": "project_name", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^4.0.2", "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "@ng-idle/core": "^2.0.0-beta.11", "@ng-idle/keepalive": "^2.0.0-beta.11", "@ng2-dynamic-forms/core": "^1.4.18", "@ng2-dynamic-forms/ui-primeng": "^1.4.18", "@types/file-saver": "0.0.1", "angular-file-saver": "^1.1.3", "chart.js": "^2.6.0", "core-js": "^2.4.1", "file-saver": "^1.3.3", "font-awesome": "^4.7.0", "moment": "^2.18.1", "ng2-page-scroll": "^4.0.0-beta.7", "ng2-scroll-to": "^1.0.7", "ng2-translate": "^5.0.0", "primeng": "^4.1.1", "rxjs": "^5.1.0", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "1.0.0", "@angular/compiler-cli": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" } }

2 个答案:

答案 0 :(得分:2)

我有同样的问题,因为我在polyfills.ts中取消注释这导入

 import 'core-js/es6/symbol';
 import 'core-js/es6/object';
 import 'core-js/es6/function';
 import 'core-js/es6/parse-int';
 import 'core-js/es6/parse-float';
 import 'core-js/es6/number';
 import 'core-js/es6/math';
 import 'core-js/es6/string';
 import 'core-js/es6/date';
 import 'core-js/es6/array';
 import 'core-js/es6/regexp';
 import 'core-js/es6/map';
 import 'core-js/es6/weak-map';
 import 'core-js/es6/set';

 import 'core-js/es6/reflect';

答案 1 :(得分:0)

在angular 8中,请将tsconfig.json文件-“ target”:“ es2015”更改为“ target”:“ es5”,