Angular 2 css Styles are not applied

0

I have the following component

import { Component } from '@angular/core';


@Component({
  selector: 'app-root',
  templateUrl: './views/noticias/noticias.component.html',
  styleUrls: ['./views/noticias/noticias.component.css']
})

export class AppComponent {
  numeroNoticias:number = 200;
  title = 'app';
}

which if I take the html that is and everything, I never mark error that the css are wrong or that it does not find them, just never apply them, should I do something else?

    
asked by Andress Blend 16.06.2017 в 19:31
source

1 answer

0

The .css file should be at the same level as your .ts file. To avoid confusion you must use the angle cli to generate components

@Component({  
  selector: 'app-root',nent.html',  
  templateUrl: './noticias.component.html',
  styleUrls: ['./noticias.component.css']
})

Another error can be the nomenclature, check if they are called the same.

And you can always use styles.css to use global classes within your project

Greetings!

    
answered by 25.08.2017 в 13:44