function isModuleDefined #16569
Milestone
Comments
If we decided to implement this, we should not overload the angular.hasModule = function hasModule(moduleName) {
try {
angular.module(moduleName);
return true;
} catch (_ignored) {
return false;
}
}; |
In fact, I did exactly the same. It's just that this hack doesn't look elegant enough. Usually, I try not to let the code of the catch block run. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a ...
Current behavior:
When redefine module, orgin module lost.
Expected / new behavior:
Override a module, or do something whether the modele is defined or not.
Minimal reproduction of the problem with instructions:
none
AngularJS version: 1.x.y
all
Browser: [all]
Anything else:
before the code:
add:
then I can user like this:
The text was updated successfully, but these errors were encountered: