angular.js - angularjs 指令问题
滿天的星座
滿天的星座 2017-05-15 16:51:45
0
1
537

在用指令的时候有一个疑惑,如果我有个select的插件,我目前是写在指令中,通过scope获取控制器的option数据,但是当select选择触发事件的时候,会执行不同方法。请问如果有不同的地方用这个指令,是要写多个指令来区分不同的方法?还是写一个指令,然后在某处执行不同的方法?是否有案例呢~?感谢

滿天的星座
滿天的星座

reply all(1)
小葫芦

See below: angular-smart-chartist directive plug-in. In the example given, multiple references to the directive appear on the same page, instead of writing multiple different directives.

In fact, the directive uses 'scope' to obtain a separate scope for it, making it possible to reuse it

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!