How to make a component of a module in angular 2?

I have such a component:

import { Component, Input, Output, EventEmitter } from '@angular/core';

@Component({
 moduleId: module.id
 selector: 'shop-checkbox',
 styles: [require('./checkbox.component.css')],
 template: require('./checkbox.component.html'),
})

export class CheckboxComponent {
 @Input() checked: boolean;
 @Output() change = new EventEmitter();

 changeCheckbox() {
 this.checked = !this.checked;
this.change.emit(this.checked);
}
}


<div class="checkbox" [ngclass]="{active: checked}" (click)="changeCheckbox()">

 <div class="view"></div>
 <span>Name {{checked}}</span>

</div>


.checkbox.active .view {
 background-color: blue;
}


If the module is placed in node_modules, upon connection error 'Expected 'styles' to be an array of strings.' in styles: [require('./checkbox.component.css')];
but if styleUrls: [./checkbox.component.css'] the problem with the tracks;

How to be ?
Thanks for the reply
July 8th 19 at 12:24
1 answer
July 8th 19 at 12:26
As I understand it, you have a checkbox.component.css is in the same folder where the module is. If so, then you have the decorator written
moduleId: module.id
When there is a guide, the files must be in the current folder of the module and path are entered without "./"

Find more questions by tags AngularJavaScriptTypeScript