Angular 6 not applying scss styles

UI Components for Angular
Post Reply
Artis125
Posts: 1
Joined: 04 Jan 2021, 10:56

21 Jul 2021, 09:38

I have a component page and corresponding style sheet, however the classes in the component.scss dosen't apply to the page. There are no errors, I am still wondering why?

This is my product-detailpage.component.html

Code: Select all

<div>
  <h1>Product Detail Page</h1>
</div>
This is the .ts file

import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ProductdetailService} from '../productdetail.service';
@Component({
  selector: 'app-product-detailpage',
  templateUrl: './product-detailpage.component.html',
  styleUrls: ['./product-detailpage.component.scss']
})
export class ProductDetailpageComponent implements OnInit {

  constructor(private route: ActivatedRoute, private productData: ProductdetailService) {
    this.route.params.subscribe(params => console.log(params));
   }

  ngOnInit() {
  }

}

This is the .scss file

Code: Select all

body{color:Red !important}
app-product-detailpage{
        h1{color:red !important}
}
However one thing I noticed was if I make changes to the global styles.css it works fine. just to check I changed the body color to green and it works.

My angular app is configured to work with scss. what could be the reason? can some one suggest?

www.targetpayandbenefits.com

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: razepu and 10 guests