首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在角-4中获得未定义或空引用的属性“应用”并使用角-cli。

无法在角-4中获得未定义或空引用的属性“应用”并使用角-cli。
EN

Stack Overflow用户
提问于 2017-05-18 09:19:25
回答 1查看 3.3K关注 0票数 1

我正在使用NG2-管理仪表板库,一周前我已经更新到最新版本,似乎从最近几天开始,我无法用IE11运行我的应用程序,但它在Chrome和Mozilla浏览器中打开并运行。

下面是我的文件有关这个问题,polyfills.ts和package.json和错误,

  1. 错误:

DOM7011:此页面上的代码禁用了回退和转发缓存。有关更多信息,请参见:http://go.microsoft.com/fwlink/?LinkID=291337 more HTML1300:导航已发生。my list SCRIPT5007:无法获得未定义或空引用vendor.bundle.js (23012,5)的属性“应用”

  1. package.json:{ "name": "ng2-admin", "version": "1.0.0", "description": "Angular and Bootstrap 4 Admin Template.", "author": "Akveo ", "homepage": "[http://akveo.github.io/ng2-admin/](http://akveo.github.io/ng2-admin/)", "repository": { "type": "git", "url": "[https://github.com/akveo/ng2-admin.git](https://github.com/akveo/ng2-admin.git)" }, "bugs": { "url": "[https://github.com/akveo/ng2-admin/issues](https://github.com/akveo/ng2-admin/issues)" }, "license": "MIT", "scripts": { "ng": "ng", "rimraf": "rimraf", "changelog": "standard-changelog", "start": "ng serve --deploy-url \"[http://localhost:4200/](http://localhost:4200/)\"", "start:hmr": "ng serve --hmr", "start:aot": "ng serve --aot", "start:prod": "ng serve --prod", "start:prod:aot": "ng serve --prod --aot", "build": "npm run clean:dist && ng build && gulp default", "build:prod": "npm run build -- --prod", "build:prod:aot": "npm run build:prod -- --aot", "build:ci": "npm run build:prod && npm run build:prod:aot", "build:demo": "npm run build:prod:aot -- --base-href \"[http://akveo.com](http://akveo.com/) /ng2-admin/\"", "test": "ng test -sr", "test:coverage": "npm run clean:coverage && ng test -sr -cc", "lint": "ng lint", "lint:styles": "stylelint ./src/app/\*\*/\*.scss", "lint:ci": "npm run lint && npm run lint:styles", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "ng e2e", "clean:dist": "npm run rimraf -- dist", "clean:coverage": "npm run rimraf -- coverage", "docs:deploy": "wintersmith build -C docs && gh-pages -d docs/build", "docs:serve": "wintersmith preview -C docs" }, "private": true, "dependencies": { "@angular/animations": "4.1.0", "@angular/common": "4.1.0", "@angular/compiler": "4.1.0", "@angular/core": "4.1.0", "@angular/forms": "4.1.0", "@angular/http": "4.1.0", "@angular/platform-browser": "4.1.0", "@angular/platform-browser-dynamic": "4.1.0", "@angular/platform-server": "4.1.0", "@angular/router": "4.1.0", "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.25", "@ngx-translate/core": "6.0.1", "@ngx-translate/http-loader": "0.0.3", "amcharts3": "github:amcharts/amcharts3", "ammap3": "github:amcharts/ammap3", "angular2-datatable": "0.6.0", "animate.css": "3.5.2", "bootstrap": "4.0.0-alpha.6", "chart.js": "1.1.1", "chartist": "0.10.1", "chroma-js": "1.3.3", "ckeditor": "4.6.2", "core-js": "2.4.1", "easy-pie-chart": "2.1.7", "font-awesome": "4.7.0", "fullcalendar": "3.3.1", "google-maps": "3.2.1", "ionicons": "2.0.1", "jquery": "3.2.1", "jquery-slimscroll": "1.3.8", "leaflet": "0.7.7", "leaflet-map": "0.2.1", "lodash": "4.17.4", "ng2-ckeditor": "1.1.6", "ng2-completer": "1.3.1", "ng2-handsontable": "0.48.0", "ng2-slim-loading-bar": "4.0.0", "ng2-smart-table": "1.0.3", "ng2-tree": "2.0.0-alpha.5", "ngx-uploader": "2.2.5", "normalize.css": "6.0.0", "roboto-fontface": "0.7.0", "rxjs": "5.1.1", "zone.js": "0.8.5", "@ng-idle/core": "_", "@ng-idle/keepalive": "_", "moment": "_", "ng2-toastr": "_", "owasp-password-strength-test": "\*" }, "devDependencies": { "@angular/cli": "1.0.1", "@angular/compiler-cli": "4.1.0", "@types/fullcalendar": "2.7.40", "@types/jasmine": "2.5.38", "@types/jquery": "2.0.41", "@types/jquery.slimscroll": "1.3.30", "@types/lodash": "4.14.61", "@types/node": "6.0.69", "codelyzer": "2.0.0", "gh-pages": "0.12.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-coverage-istanbul-reporter": "0.2.0", "karma-jasmine": "1.1.0", "karma-jasmine-html-reporter": "0.2.2", "npm-run-all": "4.0.2", "protractor": "5.1.0", "rimraf": "2.6.1", "standard-changelog": "1.0.1", "stylelint": "7.10.1", "ts-node": "2.0.0", "tslint": "4.5.0", "tslint-eslint-rules": "3.5.1", "tslint-language-service": "0.9.2", "typescript": "2.3.2", "typogr": "0.6.6", "underscore": "1.8.3", "wintersmith": "2.2.5", "wintersmith-sassy": "1.1.0", "del": "\*", "gulp": "\*" } }
  2. polyfills.ts ` /**
代码语言:javascript
复制
- This file includes polyfills needed by Angular and is loaded before the  app.
- You can add your own extra polyfills to this file. \*
- This file is divided into 2 sections:
- ​
    1. Browser polyfills. These are applied before loading ZoneJS and are  sorted by browsers.

代码语言:javascript
复制
- ​
    1. Application imports. Files imported after ZoneJS that should be  loaded before your main

/****************************************************************************

-浏览POLYFILLS */

/** IE9、IE10和IE11需要以下所有的填充。** / /导入‘core-js/es6/符号’;//导入'core-js/es6/object';//导入'core-js/es6/function';// import‘core-js/es6/parse’;// import‘core-js/es6/parse’;//导入'core-js/es6/number';//导入'core-js/es6/math';//导入'core-js/es6/string';//导入“core-js/es6/date”;//导入“core-js/es6/array”;//导入“core-js/es6/regexp”;//导入“core-js/es6/map”;//导入“core-js/es6/set”;

/** IE10和IE11对于SVG元素* / /导入'classlist.js';//运行npm install --save classlist.js需要以下NgClass支持。

/** IE10和IE11需要以下条件来支持@angular/animation。* / /导入‘web-动画-js’;//运行npm install --save web-animations-js

/**常绿浏览器需要这些。**/进口“core-js/es6/reflect”;进口“core-js/es7/reflect”;

/**所有的火狐浏览器都需要以下内容来支持@angular/animation。** / /导入‘web-动画-js’;//运行npm install --save web-animations-js

/****************************************************************************

/****************************************************************************

代码语言:javascript
复制
    - APPLICATION IMPORTS \*/

/**

代码语言:javascript
复制
    - Date, currency, decimal and percent pipes.
    - Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 \*/ // import 'intl';  // Run `npm install --save intl`.

`

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-05-20 11:36:32

我也有和你一样的问题。

我已解决了我的问题,增加了填充物:

代码语言:javascript
复制
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
 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/set';

有关更多细节,请参阅我的博客文章:http://kosmisch.net/Blog/DotNetEssential/Archive/2017/5/20/issue-unable-to-get-property-apply-of-undefined-or-null-reference-occurred-in-angular-4-vs2017-153-aspnet-core-20.html

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44043614

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档