Closed Vijay-P1999 closed 1 year ago
Please provide a stackblitz reproduction
Repo with above mentioned error - https://stackblitz.com/edit/angular-pjv2oh?file=src/main.ts
The console shows you that hljs library was not imported, it seems that in stackblitz environment you used, importing is not supported for some reason.
Here is a fixed stackblitz https://stackblitz.com/edit/angular-y9ekjq?file=src%2Fmain.ts,src%2Fglobal_styles.css
Here is the official stackblitz https://stackblitz.com/edit/ngx-highlightjs
Using a standalone component with following config
dummy.component.html
app.module.ts doesn't have any providers included in it.
packages used:
ngx-highlightjs@6.1.3 (using this because latest version seems to be in conflict with angular 14) highlight.js@11.7.0 highlightjs-line-numbers.js@2.8.0
OS and Version
Versions
npm--version 8.16.0
The log given by the failure
[HLJS] Highlight.js library was not imported!
Desired functionality
Display styled json with keys & values in different colors.
How to highlight JSON using ngx-highlightjs ?? why line-numbers are showing up
sample: