How to inject one javascript file into different Jquery-plugin to access the functions from javascript
startTransactionController.js
var app = angular.module('myApp');
app.controller('startTransactionCtrl', [
'$scope',
'secondFileService',
function ($scope, secondFileService){
..
..
secondFileService.ICanAccessFunctionHere();
..
}
]);
validateTransaction.js -- jQuery-Plugin
(function($) {
'use strict';
$.fn.validateTransaction = function( someObject ) {
var _this = this;
..
..
/*** secondFileService.ICanNotAccessFunctionHere();; ***/
Here, how can I call this function ???
..
..
}
})(jQuery);
In the validateTransaction.js, how can I inject the dependency of secondFileService to call the function ?? Like I did in the startTransactionController.js