0

In the project linked here, I'm creating a website that will show some property listing That I will have under contract. I'm having some mix ups between using the scss and css file. The tutorial I watched, the person used scss files. After discussing with a friend, I decided to used css instead. Now I'm having trouble in terms of trying to write code in css with out the style preprocessor options. Since i'm on visual code I usually use the problems tab in order to help me debug. But the errors are only in the terminal.

Error messages

Also, with the latest version of angular 6, does anyone know how to implement the style preprocessor options?


After doing what was suggested:

i changed the stylesURL and wanted to test with ng serve -o

Shown here

I then used the command ng config defaults.styleExt=css: Shown Here

Darnell
  • 1
  • 1
  • when you go to your header.component.ts file. What does your @Component selector has when its referencing 'styleUrls', what is the extension on your file? – O.MeeKoh Mar 18 '19 at 20:58
  • ```import { Component } from '@angular/core'; @Component({ selector: "ws-header", templateUrl: "./header.component.html", styleUrls: ["./header.component.scss"] }) export class HeaderComponent { }``` – Darnell Mar 18 '19 at 21:01
  • Welcome to stackoverflow. In the future: best practice is to include the text of the error messages, rather than as images. – Simon.S.A. Mar 19 '19 at 00:04

1 Answers1

0

in your header.component.ts file change this styleUrls: ["./header.component.scss"] to this styleUrls: ["./header.component.css"]

And try running this command ng config defaults.styleExt=css and try following this answer

That should fix your error.

O.MeeKoh
  • 1,976
  • 3
  • 24
  • 53
  • It didnt work :(, hold on a sec, I'll edit the question and show what im talking about – Darnell Mar 18 '19 at 21:17
  • I was able to build your project without issues. I first commented everything out in the styles.css file. Mainly because you have both css and scss in that file which is causing issues. Delete any .scss references. Delete the src/styles/_.scss file. and delete the .scss file from the header folder. Also change the header.component.ts file to reference styles .css as in my answer above. This should build your project just fine – O.MeeKoh Mar 18 '19 at 21:27