DEV Community

Alaa Courdova
Alaa Courdova

Posted on

 

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 {
  }
}

Enter fullscreen mode Exit fullscreen mode

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

Top comments (2)

Collapse
 
naubit profile image
Al - Naubit

Hey, that was a nice read, you got my follow, keep writing 😉

Collapse
 
alaa_courdova profile image
Alaa Courdova

I appreciate it , thank you

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.