Electron error
Electron node.js application has both module.exports and window variables and thus alight get into module.exports instead of window variable.
it's ok, when amd/commonjs is available, then alight works via "require" instead of put it to window
But it's not ok in electron browser.
why? you can do: window.alight = require('alight')
Because I'm using it as a client library for ui and load it from bower component directory with <script>.
some developers use requirejs for client libraries, and window shouldn't be spoiled. method "require" is available for you? is ok if you will use function "alightInitCallback" to receive alight?
I've tried alightInitCallback but with no success. Now I'm using require method. But I think It should be solved somehow or clarified in the doc.
I've tried alightInitCallback but with no success.
I increased priority for "alightInitCallback", now it will test before define/require.
But I think It should be solved
I will add it to FAQ, if you have idea how to fix it, tell me (problem: if requirejs is used, then global alight shouldn't be created) as version, if "window.alightInitCallback === true", then alight works as default
I think it should be detected define function from requirejs.
it checks if define is exist: https://github.com/lega911/angular-light/blob/master/src/js/postfix.js#L10
So we have wrong behaviour in atom when module.exports is presented. It could be solved with comparing global or window with this.
Code duplication found https://github.com/lega911/angular-light/blob/master/src/js/postfix.js#L16
what do you propose? if(this != window) window.alight = alight; or if(typeof(global) !== 'undefined') window.alight = ...
Code duplication found
yes, thank you, I had fixed it