Angular 9.1 displayBlock CLI Component Generator Option by Example
In this post we will give you information about Angular 9.1 displayBlock CLI Component Generator Option by Example. Hear we will give you detail about Angular 9.1 displayBlock CLI Component Generator Option by ExampleAnd how to use it also give you demo for it if it is necessary.
In this article, we’ll learn about the new displayBlock
option for the Angular 9.1 CLI component generator.
When you use the CLI to generate an Angular component, it will be displayed inline
by default using the CSS inline property, as this is the default display for most DOM elements.
Displaying Angular Components with the display: block
CSS style
More often than not, you’ll need display your components with the display: block
CSS style.
Instead of changing this manually for each new component you generate, you now have the option to set it automatically when using the CLI thanks to the displayBlock
introduced in Angular 9.1.
Using Angular 9.1 CLI displayBlock
by Example
This is how you use this option when generating a new Angular component:
ng generate component home --displayBlock
You can also make display:block
by default by setting theschematics.@schematics/angular:component.displayBlock
key in your angular.json
to true, or also run the following command in your terminal:
ng config schematics.@schematics/angular:component.displayBlock true
Hope this code and post will helped you for implement Angular 9.1 displayBlock CLI Component Generator Option by Example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs