material
material copied to clipboard
[Question] How can I embed a md-button inside md-list-item in a md-list
Each row is a md-list-item it can be clickable with ng-click1 Each row contains a md-button which can also be clickable with ng-click2 When user click the area without md-button, it will execute ng-click1. if click the button will execute ng-click2 function.
Right now when I click the button, button's ng-click is not working, can't accept the click event.
One of the guys on my team accomplished this by making a localize event directive we can slap on buttons and the like
(function() {
app.directive('localizeEvent', [
function () {
return {
restrict: 'A',
link: function(scope, element, attrs) {
$(element).click(function(e) {
e.stopPropagation();
});
}
};
}
]);
})();
Can you provide a Codepen or Plunkr demo that shows what you're trying to achieve?