search

Home  >  Q&A  >  body text

angular.js - angularjs directive issue

I have a doubt when using the command. If I have a select plug-in, I currently write it in the command and get the option data of the controller through the scope. But when the select triggers the event, different methods will be executed. . If this instruction is used in different places, do I need to write multiple instructions to distinguish different methods? Or write an instruction and then execute a different method somewhere? Are there any cases? Thanks

滿天的星座滿天的星座2825 days ago668

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-05-15 16:53:45

    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

    reply
    0
  • Cancelreply