4

jqliteを使用してAngularで要素のattrデータを取得するにはどうすればよいですか?

html、

<button ng-click="loadForm($event)" href="form.php">Load Directive Form</button>
<div data-my-form></div>

角度のある、

     app.directive('myForm', function() {
        return {
          controller:function($scope){
            $scope.isLoaded = false;
            $scope.loadForm = function(e){

                console.log(e.target.attr('href')); // error 

                var form = e.target.attr('href'); // error

                $scope.isLoaded = true;
            }
          },
          template: '<div><div ng-if="isLoaded" ng-include="'+ form +'" ></div></div>',
          link:function(scope, element) {

          }
        }
    });

このエラーが発生します。

TypeError: e.target.attr is not a function

何か案は?

4

1 に答える 1