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

前端之家收集整理的这篇文章主要介绍了angular-cli – Angular Cli支持内联模板和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
      }
    }
  }

猜你在找的Angularjs相关文章