In my application, I have a button with a click even on it:
<button class="btn btn-default" (click)="doSomething()">
From the method, is doSomethingthere a way to remove the event (click)from the button (so that the user can no longer activate the function)?
I tried to set the disabled support button, but did not change the behavior of Angular2.
I tried to use (click)="doSomething($event)and then
doSomething($event) {
...
...
console.log('Method Logic');
let target = event.target || event.srcElement || event.currentTarget;
this.renderer.listen(target, 'click', (event) => {
console.log('clic block');
});
}
But it does not "replace" the click event. Thus, after clicking the button, both the initial logic and the click block console log are launched.
source
share