angular-highlightjs icon indicating copy to clipboard operation
angular-highlightjs copied to clipboard

use require.js was Error

Open ermu592275254 opened this issue 8 years ago • 2 comments

when I use require.js management of my js code,load the angular-highlight.js is failed, The error message: "GET http://localhost:3000/js/hljs.js 404" but I did't create hljs.js file. and "require.js:166 Uncaught Error: Script error for: hljs"

I load highlight.js and angular.js is succeed, console.log('hljs') can see something about it.

how i need set angular-highlight.js??

ermu592275254 avatar Oct 24 '16 03:10 ermu592275254

Hi @ermu592275254

Sorry for the late response.

highlight.js originally have their AMD module defined as hljs. They've changed it to anonymous at https://github.com/isagalaev/highlight.js/commit/b4ea6460c91ca410bded7e4bdab346f4382c55b3.

You'll have to defined it yourself in order to use it with current angular-highlightjs.

See https://github.com/isagalaev/highlight.js/issues/1288#issuecomment-243972595

pc035860 avatar Nov 21 '16 05:11 pc035860

Use highlight.js --> $('pre code').each(function(i, block) { hljs.highlightBlock(block); });

caemasar avatar Sep 21 '17 03:09 caemasar