Open n1kos opened 7 years ago
This won't work because in the first method you can explicitly say that use "Upload" as $upload. However, in the second method, you can't. Still, you can inject the Upload as this if you really really want to refer it as $upload even though I'm not recommending it.
/** @ngInject */
function ctrl(d1, d2, Upload) {
var $upload = Upload;
}
Actually I tried that as well, it didn't work either.
Ok, not sure if this is actually an issue, but can't find any information on the subject
When you DI using the angular annotation ie
angular.module("app") .controller("ctrl", ["d1", "d2", "Upload", function(d1, d2, $upload){ $upload }])
everything works fine. But, when you try to use ngInject, ie
angular.module('app").controller("ctrl", ctrl); /** @ngInject */ function ctrl(d1, d2, Upload) { $upload }
$upload is undefined. Is there a way to reference Upload as $upload? (ReferenceError: $upload is not defined, on file.upload = $upload.upload())Thanks