How do I pass multiple attributes into an Angular.js attribute directive?

后端 未结 5 1009
长发绾君心
长发绾君心 2020-11-30 18:57

I have an attribute directive restricted as follows:

 restrict: \"A\"

I need to pass in two attributes; a number and a function/callback, a

5条回答
  •  旧时难觅i
    2020-11-30 19:19

    This worked for me and I think is more HTML5 compliant. You should change your html to use 'data-' prefix

    And within the directive read the variable's value:

    scope: {
            number : "=",
            ....
        },
    

提交回复
热议问题