This commit is contained in:
Jan Klattenhoff 2024-08-20 14:26:19 +02:00
parent d1db066c74
commit 4c94212b7f
14 changed files with 567 additions and 349 deletions

View file

@ -0,0 +1,3 @@
<h1>Child</h1>
<p>Balance: {{balance}}</p>
<button type="button" (click)=takeMoney() class="btn btn-secondary">Take Money</button>

View file

@ -0,0 +1,16 @@
import { Component, Input, Output, EventEmitter } from "@angular/core";
@Component({
selector: 'app-child',
standalone: true,
templateUrl: './child.component.html',
})
export class ChildComponent {
@Input() public balance:number = 0;
@Output() balanceChange = new EventEmitter<number>();
public takeMoney() {
this.balance -= 50;
this.balanceChange.emit(this.balance);
}
}