私は次の要素を持っています、
<button test-directive>value</button>
を使用できることはわかっていng-click directive
ますが、コントローラーから関数を呼び出す必要があります。ユーザーがクリックすると、例で呼び出されるディレクティブを起動したいtest-directive
testModule.directive('testDirective', function(){
return {
restrict: 'A',
link: function(scope, element, attrs) { }
}
})
このディレクティブでng-clickを実装するにはどうすればよいですか?
ありがとうございました