Angular 无法定位样式表警告
Angular unable to locate stylesheet warning
我收到了这样的警告
Warning: Unable to locate stylesheet: D:\Angular\certification\Angular8Certification\https:\stackpath.bootstrapcdn.com\bootstrap.4.1\css\bootstrap.min.css
我是 Angular 的新手。当我添加 css 它不适用。这是什么原因,我该怎么办?
这是我的控制台
编辑:
此警告是由 polyfill 中的新更新引起的。
解决方法是:
从 index.html
中删除所有 bootstrap cdn 链接
安装bootstrap >
npm install bootstrap
接下来进入angular.json文件,将BootstrapCSS和JavaScript文件的路径添加到styles和scripts数组下构建目标如下:
再次ng serve --open
。
结果
这个解决方案对我有用。
我收到了这样的警告
Warning: Unable to locate stylesheet: D:\Angular\certification\Angular8Certification\https:\stackpath.bootstrapcdn.com\bootstrap.4.1\css\bootstrap.min.css
我是 Angular 的新手。当我添加 css 它不适用。这是什么原因,我该怎么办?
这是我的控制台
编辑:
此警告是由 polyfill 中的新更新引起的。
解决方法是:
从 index.html
中删除所有 bootstrap cdn 链接安装bootstrap >
npm install bootstrap
接下来进入angular.json文件,将BootstrapCSS和JavaScript文件的路径添加到styles和scripts数组下构建目标如下:
再次ng serve --open
。
结果
这个解决方案对我有用。