For example:
angular.module('someName', []).
directive('someName', function() {
...
});
Can this potentially cause problems in AngularJS? Should this be avoided?
A module and a directive can have the same name. You could even include a service, factory, or provider with the same name as the module, but not the same name as one another.
The reason you can use the same name for the directive as the module is because the modules and their names are stored in one object and the directives and their names are stored in another object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With