1.0.3 • Published 7 years ago

@petkit/ngx-highlight v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

ngx-highlight

angular highlight component

Installation

npm install --save @petkit/ngx-highlight highlight.js

Usage

Import style

// Add the following code to global styles.
// if your project is created by angular-cli, you can add the following code to 'style.scss' in src dir.
@import '~highlight.js/styles/default.css';

Or add it to angular.json file

...
"architect": {
  "build": {
    "options": {
      "styles": {
        "src/styles.css",
        "~highlight.js/styles/default.css"
      }
    }
  }
}
...

Import Module

import { NgxHighlightModule } from '@petkit/ngx-highlight';

@NgModule({
  imports: [
    ...
    NgxHighlightModule,
  ],
})

Usage

<ngx-highlight [code]="'<h1>code</h1>'" lang="html"></ngx-highlight>
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago