On Karma when running tests under environments such as Nativescript, standard browser variables such as window and self do not exist. In this case adding the library to the 'this' variable which is the global scope is a sensible failsafe which works.
This change does not break any existing tests.
I have included an alternate way of writing the loading code as taken from moment.js. Feel free to choose which you prefer.
Fixes issue #14
On Karma when running tests under environments such as Nativescript, standard browser variables such as window and self do not exist. In this case adding the library to the 'this' variable which is the global scope is a sensible failsafe which works.
This change does not break any existing tests.
I have included an alternate way of writing the loading code as taken from moment.js. Feel free to choose which you prefer.