Using Component Styles

There are two ways we can add styles in our component.

First Method:
@Component({
  selector: 'pm-products',
  templateUrl: './product-list.component.html',
  styles: ['thead {color: #337ab7;}']
})

Second Method:
@Component({
  selector: 'pm-products',
  templateUrl: './product-list.component.html',
  styleUrls: ['./product-list.component.css']
})

We'll be using second method for our application.

Inside 'product' folder, add new file named 'product-list.component.css' and the css
thead {
  color: #337ab7;
}

In 'product-list.component.ts' file, add the styleUrls
@Component({
  selector: 'pm-products',
  templateUrl: './product-list.component.html',
  styleUrls: ['./product-list.component.css']
})

Share this

Related Posts