Angular for syntax highlighting with highlight.js
npm install ngx-highlight-jsAngular for syntax highlighting with highlight.js



```
npm install --save ngx-highlight-js
Load the highlight.js and theme css in page.
`html`
`typescript
import { Component } from '@angular/core';
import { HighlightJsDirective } from 'ngx-highlight-js';
@Component({
selector: 'test',
template: ,`
imports: [HighlightJsDirective]
})
export class SimpleComponent {}
`html
@Component({
selector: 'demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.scss']
})
export class DemoComponent {
switchStatus: boolean = true;
}
`
Will render each
:`html
`$3
| Property | Description | Type | Default | Global Config |
| ----------- | -------------------------------------------------------------------------------------------------------- | ----------------- | -------- | ------------- |
|
[mode] | - default Will render each
- simple Render all content according to lang language | default, simple | simple | ✅ |
| [options] | Equar configure(options) | any | - | ✅ |
| [lang] | Uses language detection by default but you can specify the language | string | html | ✅ |
| [code] | Specify content | string | html | - |Global Config
`ts
@NgModule({
providers: [provideHighlightJsConfig({ lang: 'html' })]
})
export class AppDemoModule {}
``Troubleshooting
Please follow this guidelines when reporting bugs and feature requests:
1. Use GitHub Issues board to report bugs and feature requests (not our email address)
2. Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.
Thanks for understanding!
$3
The MIT License (see the LICENSE file for the full text)