Angular Cli support for inline templates and css

Does the latest version of Angular cli support built-in templates and css for components? I no longer see the -inline-template option?

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

+5
source share
1 answer

In your angular-cli.json file, you can specify whether you want your files to have built-in css and templates.

Here you can find all the parameters that you can specify in the configuration file.

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

That way, when you use the ng generate component , it will use the default values.

 { "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 } } } 
+6
source

Source: https://habr.com/ru/post/1261298/


All Articles