styleUrls not working in Angular 2

You just need to remove the slash from the beginning of the styleUrls path like this:

@Component({
    selector: 'dashboard',
    templateUrl: '/app/components/dashboard/dashboard.html',
    styleUrls: ['app/components/dashboard/dashboard.css']
})

Leave a Comment