2

属性タイプ (制限: 'A') の my-directive というカスタム ディレクティブがあります。次のように使用します。

<input my-directive="mydvalue"/>

ディレクティブ内で「mydvalue」を取得するにはどうすればよいですか?

app.directive("myDirective", function (){
   return {
      restrict: 'A',
      link: function(scope, el, attrs, controller) {
         //How do i get the mydvalue here.

      }

  };

});
4

1 に答える 1