README
skv-editor
Installation
To install this library, run:
$ npm install skv-editor --save
Consuming your library
Once you have published your library to npm, you can import your library in any Angular application by running:
$ npm install skv-editor
and then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { SkvEditorModule } from 'skv-editor';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SkvEditorModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html -->
<skv-editor [data]="result" [options]="options" (onUpdate)="update($event)"></skv-editor>
/* You can now use your library component in app.component.ts */
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
result: string = "";
// set default color option
options:any = {
"background-color": "#415b8a",
"color": "#ffffff",
"border": "2px solid #415b8a"
}
update(elem:string) {
this.result = elem;
}
}
$ npm run lint
License
MIT © Santosh