material icon indicating copy to clipboard operation
material copied to clipboard

[Question] How can I embed a md-button inside md-list-item in a md-list

Open alexliubj opened this issue 11 years ago • 2 comments

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.

alexliubj avatar Jul 31 '15 13:07 alexliubj

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();
                    });
                }
            };
        }
    ]);
})();

KReden avatar Jul 31 '15 18:07 KReden

Can you provide a Codepen or Plunkr demo that shows what you're trying to achieve?

marcysutton avatar Oct 12 '15 17:10 marcysutton