angular-clipboard
angular-clipboard copied to clipboard
Check for angular being available as global variable before using require
When I've a context where there is require available, but loading angular directly via a file (which might very well be the case for an electron app), your method of requiring angular throws errors. If you add a simple check if angular is defined as global variable first, everything should be fine.
I am using standard UMD which should be compatible with both CJS (node/electron) as well as requirejs and normal browser loading.
If angular is not available before this module is loaded, it will not work. It needs to register itself in the angular runtime to be available.
I suspect you need to refactor your code a bit to ensure that angular loads before any plugins/extensions.
Angular is loaded before, is available as global var and works fine, but it is not included as node module, but via simple (Bower based) file include. When a global require
function is available too as it will be for electron apps, you're module throws errors.
it's working on a specified version of angular? i'm using the last version of angular and i get this error : Error: $injector:modulerr Module Error. Error: [$injector:modulerr] http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=a...) at http://prestodev.itsign.ro/bundles/mountfrontend/bower_components/angular/angular.min.js?version=v14:6:412
please help :(
I have the same problem, do you have any news?