Answer the question
In order to leave comments, you need to log in
How to make a module from a component in angular 2?
For example, I have 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;
}
styles: [require('./checkbox.component.css')];
styleUrls: [./checkbox.component.css']
then the problem is with the paths; Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question