In this stackblitz example
When I click on red button, I should only see red in console and not gray. How can I achieve that?
import { Component, Input } from '@angular/core';
@Component({
selector: 'hello',
template: `
<button style="height: 100px; width: 200px;" (click)='gray()'> Gray
<button style="height: 20px; width: 40px; background-color:red" (click)='red()'>
Red
</button>
</button>`,
styles: [`h1 { font-family: Lato; }`]
})
export class HelloComponent {
red() {
console.log('red');
}
gray() {
console.log('gray');
}
}
Edit: I have tweaked the question to be a button inside a div