Open nine-2-five opened 8 years ago
Hi @isvaljek ,
I'm not familiar with Electron.
The error seems related to angular
module can not be found.
angular
is a required dependency in the case that your module loader/bundler treats angular-highlightjs
as an AMD/CommonJS module.
You'll have to somehow tell the bundler that your angular
is in the global.
e.g. browserify-shim for browserify
Thanks Chih-Hsuan, but I don't know that if Electron even has a module loader. All the other angular scripts like material and ui-router are loaded by script tag in the main index.html.
2016-07-05 16:17 GMT+02:00 Chih-Hsuan Fan notifications@github.com:
Hi @isvaljek https://github.com/isvaljek ,
I'm not familiar with Electron. The error seems related to angular module can not be found. angular is a required dependency in the case that your module loader/bundler treats angular-highlightjs as an AMD/CommonJS module.
You'll have to somehow tell the bundler that your angular is in the global.
e.g. browserify-shim https://github.com/thlorenz/browserify-shim for browserify
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pc035860/angular-highlightjs/issues/70#issuecomment-230490976, or mute the thread https://github.com/notifications/unsubscribe/ACYmq3JWh9DBfLDGMxYAEHnvbat8jvOEks5qSmdlgaJpZM4JFBjw .
It seems that the <script></script>
environment provided in Electron app's index.html
actually uses node-like module system (CommonJS).
I guess if you simply install angular
with npm rather than bower will solve the issue.
After install angular
via npm, change the angular script tag to something like:
<script src="path_to_node_module/angular/angular.min.js"></script>
<script src="other angular modules"></script>
or
<script>
window.angular = require('angular');
</script>
<script src="other angular modules"></script>
I'm having trouble loading this script in an Electron app. Angular app is working fine with the basic highlight.min.js script, but when I add your script after the angular.js script I get this: