Closed edrorr closed 3 years ago
The issue is probably with the project setup you have, could be because the typescript version you are using... try it out with a a new angular project
Did you ever fix this?
I am having the same issue.
Typescript 3.9.7 Angular 10.0.14 Angular CLI 10.0.8
@matthewdolman No unfortunately i didn't had time and ended up importing the js file in angular.json
try
coreLibraryLoader: loadHighlightJs
instead of
coreLibraryLoader: loadHighlightJs()
@matthewdolman No unfortunately i didn't had time and ended up importing the js file in angular.json
hii, iam getting the same error, what js do i need to add in angular.json file, iam using angular version 8
providers: [
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
coreLibraryLoader: coreLibraryLoader,
lineNumbersLoader: lineNumbersLoader, // Optional, only if you want the line numbers
languages: {
json: languageJSON
}
}
}
]
app.module.ts
providers: [ { provide: HIGHLIGHT_OPTIONS, useValue: { coreLibraryLoader: coreLibraryLoader, lineNumbersLoader: lineNumbersLoader, // Optional, only if you want the line numbers languages: { json: languageJSON } } } ]
app.module.ts
i tried this way, and its says Highlight.js library was not imported! in browser console
Hello, I have installed ngx-highlight.js and following the provided instructions added this providers to my module
but when i run the project this errors are appearing :
so i have used the export function instead. but
and changed the useValue inside provider to this :
The error is gone but HighlightJs is not working and i have this error in the browser Console : [HLJS] Highlight.js library was not imported!
OS and Version?
Windows 10
Versions
@angular/cli 10.2.0 node 12.19.0 npm 6.14.8