I am using angularjs, underscore and jQuery in my new service:
myModule.factory(\'MyService\', [\'MyResource\', function (MyResource) {
....
// Here
based on @moderndegree's approach I have implemented the following code, I cannot say it is perfect but this way tester would know if it has jQuery dependency as $window
is too generic object to inject.
'use strict';
(function () {
var app= angular.module('app');
//these are just references the instance of related lib so we can inject them to the controllers/services in an angular way.
app.factory('jQuery', [
'$window',
function ($window) {
return $window.jQuery;
}
]);
app.factory('Modernizr', [
'$window',
function ($window) {
return $window.Modernizr;
}
]);
app.factory('Highcharts', [
'$window',
function ($window) {
return $window.Highcharts;
}
]);
})();