Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
1×
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.

Autoplay

    Configure Defaults for Generating Code with Angular CLI

    angularAngular
    ^6.0.0

    The default Angular CLI configuration generates components that consist of 4 files. The component class, an HTML template, a stylesheet and a spec file that contains the unit test.

    In order to keep our components concise we update our AppComponent and move the template and style from an external file to inline. This allows us to delete the 2 external files.

    We can configure our project to generate the template and the style 'inline' by default.

    To do this we run the commands:

    ng config schematics.@schematics/angular.component.inlineStyle true
    ng config schematics.@schematics/angular.component.inlineTemplate true

    The changes are made to angular.json in the project root.