@petkit/ngx-highlight
v1.0.3
Published
angular highlight component
Downloads
9
Readme
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>