如何解决Angular应用程序与Internet Explorer的兼容性
我有一个Angular应用程序,该应用程序具有选择地图的功能,用户可以在该地图上选择货物的交货地点。
问题是这在IE中不起作用-地图打开,但未加载交货点。 另外,如果您增加或减少地图,地图只会冻结。
我尝试取消注释polyfills.ts中的数据,但这没有帮助。现在有以下代码:
/**
* 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.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10,Chrome >= 55 (including Opera),* Edge >= 13 on the desktop,and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.
import 'classlist.js';
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default,zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded,and webpack
* will put import in the top of bundle,so user need to create a separate file
* in this directory (for example: zone-flags.ts),and put the following flags
* into that file,and then add the following code before importing zone.js.
* import './zone-flags.ts';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll','mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools,the addEventListener will also be wrapped by zone.js
* with the following flag,it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js';
这是控制台的错误输出: console output
Error:Command not supported by object(23278,23)
解决方法
我可以看到您遇到错误对象不支持属性或方法“包含”
您收到此错误,因为IE浏览器不支持String.prototype.includes()方法和Array.prototype.includes()方法。
我建议您将以下polyfill添加到polyfill.ts文件中。
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
Exception in thread django-main-thread:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",line 217,in ensure_connection
self.connect()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",line 195,in connect
self.connection = self.get_new_connection(conn_params)
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\postgresql\base.py",line 178,in get_new_connection
connection = Database.connect(**conn_params)
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\psycopg2\__init__.py",line 127,in connect
conn = _connect(dsn,connection_factory=connection_factory,**kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\threading.py",line 917,in _bootstrap_inner
self.run()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\threading.py",line 865,in run
self._target(*self._args,**self._kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\utils\autoreload.py",line 54,in wrapper
fn(*args,**kwargs)
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\commands\runserver.py",line 120,in inner_run
self.check_migrations()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\base.py",line 453,in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\migrations\executor.py",line 18,in __init__
self.loader = MigrationLoader(self.connection)
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py",line 49,in __init__
self.build_graph()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\migrations\loader.py",line 212,in build_graph
self.applied_migrations = recorder.applied_migrations()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\migrations\recorder.py",line 73,in applied_migrations
if self.has_table():
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\migrations\recorder.py",line 56,in has_table
return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",line 256,in cursor
return self._cursor()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",line 233,in _cursor
self.ensure_connection()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",in ensure_connection
self.connect()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\utils.py",line 89,in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",in ensure_connection
self.connect()
File "C:\Users\HP\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\db\backends\base\base.py",**kwasync)
django.db.utils.OperationalError: could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
它可以帮助您解决此错误。
参考:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。