Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 29, 2023 04:35 pm GMT

Using Styles and StyleUrls Component Properties in Angular

Problem
repeating a style is common while coding , for example: - container , font-style buttons ..etc.

As angular component is separated (CSS and HTML) , We face a repetitive code and if we need to change a style we needs to change many time for minor change -maybe-

Solution

styleUrls: ['./component1.scss',
'../component2.scss']

@Component({  selector: 'component',  templateUrl: './component.html',  styleUrls: ['./component1.scss',    '../component2.scss']})export class Component implements OnInit {  ngOnInit(): void {  }}

so if the style we need is existing in a different component we can add the path of CSS , better than copying the style code


Original Link: https://dev.to/alaa_courdova/using-styles-and-styleurls-component-properties-in-angular-423c

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To