加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angular-cli – Angular Cli支持内联模板和css

发布时间:2020-12-17 17:44:22 所属栏目:安全 来源:网络整理
导读:最新版本的Angular cli是否支持内联模板和组件的css?我再也看不到–inline-template选项了吗? https://github.com/angular/angular-cli 解决方法 在angular-cli.json文件中,您可以指定是否希望文件具有内联css和模板. 您可以在此处找到可在配置文件中指定
最新版本的Angular cli是否支持内联模板和组件的css?我再也看不到–inline-template选项了吗?

https://github.com/angular/angular-cli

解决方法

在angular-cli.json文件中,您可以指定是否希望文件具有内联css和模板.

您可以在此处找到可在配置文件中指定的所有选项.

https://github.com/angular/angular-cli/wiki/angular-cli

这样,当你使用ng generate组件时,它将使用默认值.

{
    "project": {
      "version": "1.0.0-beta.22-1","name": "client"
    },"apps": [
      {
        "root": "src","outDir": "build","assets": [
          "assets","favicon.ico"
        ],"index": "index.html","main": "main.ts","test": "test.ts","tsconfig": "tsconfig.json","prefix": "ws","mobile": false,"styles": [
          "styles/main.scss"
        ],"scripts": [],"environments": {
          "source": "environments/environment.ts","prod": "environments/environment.prod.ts","dev": "environments/environment.dev.ts"
        }
      }
    ],"addons": [],"packages": [],"e2e": {
      "protractor": {
        "config": "./protractor.conf.js"
      }
    },"test": {
      "karma": {
        "config": "./karma.conf.js"
      }
    },"defaults": {
      "styleExt": "scss","prefixInterfaces": false,"inline": {
        "style": true,<<<--- CHECK IT OUT!!
        "template": true
      },"spec": {
        "class": false,"component": true,"directive": true,"module": false,"pipe": true,"service": true
      }
    }
  }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读