原来是少了 .browserslistrc
文件引起的,添加下面的 .browserslistrc 文件就解决了
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# You can see what browsers were selected by your queries by running:
# npx browserslist
> 0.5%
last 5 versions
Firefox ESR
Chrome >= 55
not dead
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3
方案一 使用 babel技术
支持将es6语法 转es5 支持低版本浏览器
方案二:动态加载angular.js文件,如果是低版本的 浏览器 使用 低版本的 angular.js