Using multiple directives in require with Angularjs

后端 未结 2 1337
北恋
北恋 2021-01-18 06:28

I have the situation where i need access to multiple directive controller methods.

I can access a method from a parent directive using the require like so:



        
2条回答
  •  暖寄归人
    2021-01-18 07:09

    You need a comma after the require statement

    require:['^parentDirective','otherDirective'], //<--- right there
    

    Here's a plunker to show it working while requiring multiple directives

提交回复
热议问题