@petkit/ngx-highlight
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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>

Readme

Keywords

Package Sidebar

Install

npm i @petkit/ngx-highlight

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

62.7 kB

Total Files

24

Last publish

Collaborators

  • lovesora
  • qmy777