Closed SanderElias closed 8 years ago
@btford @SomeKittens Do you know what could be causing this? I assume batarang decorates the angular.Module functions / or provides its own implementation, and .component isn't yet part of that.
@Narretz Yep, that'd be the first place to look. I've got some time, checking into this
Here's the relevant code:
angular.module = function(name, requiresOriginal) {
var module = originalAngularModule.apply(this, arguments),
name = module.name;
module.requiresOriginal = requiresOriginal;
modules[name] = module;
var modToCheck = getModule(name, true);
//check arguments to determine if called as setter or getter
var modIsSetter = arguments.length > 1;
if (modIsSetter) {
hasNameSpace(name);
}
if(modToCheck && modToCheck.requiresOriginal !== module.requiresOriginal && modIsSetter) {
if(!modData.createdMulti[name]) {
modData.createdMulti[name] = [getModule(name,true)];
}
modData.createdMulti[name].push(module);
}
modData.createdModules[name] = module;
return module;
};
Since we're returning the result of a call to the original module
function, I'm going to punt this back over the fence.
hmm. probably .component
will get attached later, as it is an extension on .directive
. It seems batarang gets in between there. I wonder how that could happen. One would think that those things are handed around per reference.
I still think the problem is within Batarang. It is somehow defining window.angular
I think, so it is already defined when setupModuleLoader()
is executed, thus our factory function is never called.
Will have to take a closer look to make sure, though.
Hm...yes, Batarang seems to have it's own loader (to retain compatibility with v1.2.x
?).
So, it needs to get updated to include .component
I guess.
I'm punting this ba...ehm...re-opening this for further investigation :smiley:
Well, I never was very good at football anyway.
Yep, that's us, need to fix that loader. Completely forgot about it.
y'know what? Double my bad - this is a dupe of #275
If you use the .component helper form this build, and you have batarang active, the following error will be thrown.
script.js:8 Uncaught TypeError: angular.module(...).component is not a function
Took me some time to figure out what was happening... Disable batarang, and your component(s) start working!
Posted here also as sugessted in #13275