【问题标题】:Angular : Addons its not allowedAngular:不允许添加
【发布时间】:2018-08-02 10:31:06
【问题描述】:

我正在按照教程在youtube 上使用 Angular 制作网站。 我在 8:17 在 angular.json 添加插件时收到此错误,如下所示:

架构验证失败,出现以下错误: 数据路径“”不应该有额外的属性(插件)。

这是因为我在angular.json 上添加了“插件”,而教程在angular-cli.json 上添加了“插件”?

我的目录中没有angular-cli.json

我很确定我 100% 遵循本教程。我认为angular.jsonangular-cli.json之间的结构是一样的:

"styles": [
    "src/styles.scss",
    "../node_modules/font-awesome/scss/font-awesome.scss"
],
"addons": [
    "../node_modules/font-awesome/fonts/*.+(otf|eot|svg|ttf|woff|woff2)"
],
"scripts": []

【问题讨论】:

    标签: javascript json angular angular-cli


    【解决方案1】:

    addons 已根据 this 从配置中删除。

    查看the docs,了解如何包含font-awesome

    使用 SASS

    在src/中创建一个空文件_variables.scss。

    将以下内容添加到 _variables.scss:

    $fa-font-path : '../node_modules/font-awesome/fonts';

    在styles.scss 中添加以下内容:

    @import 'variables';

    @import '../node_modules/font-awesome/scss/font-awesome';

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-14
      • 2017-07-31
      • 2013-05-20
      • 1970-01-01
      相关资源
      最近更新 更多