Reputation: 3791
For example:
angular.module('someName', []).
directive('someName', function() {
...
});
Can this potentially cause problems in AngularJS? Should this be avoided?
Upvotes: 13
Views: 2389
Reputation: 3239
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.
Upvotes: 26