Now I have multiple unknown modules that need to share a directive, but I need to specify the module when defining. How should I define a common directive. You can define a global function to return a directive, but you don’t want to pollute the global environment. What should be the best way to do it?
Create a new module directly and define the directive in the module. Wherever you need this directive, can you just declare the dependency in the corresponding module?