kit-style

README

Why

In a cases when we need to bind from a component, but @HostBinding has limited functionality.

API

[class] KitStyleModule

@NgModule

[class] KitStyleService

@Injectable

Service that works exactly like ngStyle, but can be provided on a component or directive.

Usage

Provide and inject KitStyleService in a component, then apply styles:

providers: [KitStyleService],
...
constructor(private style: KitStyleService) {
}
...
this.style.style = {
 background: 'red',
 color: '#fff',
};

Members

SignatureDescription
set style(v: KitStyles)

[interface] KitStyles

Members

SignatureDescription
(key: string): string