javascript - angularjs怎么定义一个共用的directive
淡淡烟草味
淡淡烟草味 2017-05-15 17:13:44
0
1
565

现在我有多个未知module,需要共用一个directive,但在定义时需要指定module,我应该怎么定义公共的directive。可以定义一个全局的函数返回directive,但又不想污染全局环境,应该怎么做最合适?

淡淡烟草味
淡淡烟草味

reply all(1)
曾经蜡笔没有小新

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?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!