In jQuery I could create a web component like so:
jQuery
<script>
$(document).on('click', 'm-button[alert]', function(e){
alert($(this).attr('data-message');
});
</script>
HTML
<m-button alert data-message="Hello World!">Say Hello</m-button>
<m-button alert data-message="Goodbye World!">Say Bye</m-button>
When I click any of the above button I will get an alert with the text defined inside data-message attribute.
What is the best practice to do this in Angular? One way would be to assign ng-click to every <m-button>, is there any better and more efficient way?