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,6 @@
<h1>Parent</h1>
<p>Kontostand: {{ balance }}</p>
<button type="button" class="px-3 py-1 border-[3px] border-black m-3" (click)=addFifty()>Add Money</button>
<app-child [(balance)]="balance"></app-child>
<app-child [(balance)]="balance"></app-child>

View file

@ -0,0 +1,17 @@
import { Component } from "@angular/core";
import { ChildComponent } from "../Child/child.component";
@Component({
selector: 'app-parent',
standalone: true,
templateUrl: './parent.component.html',
imports: [ChildComponent],
})
export class ParentComponent {
public balance = 1000;
public addFifty() {
this.balance += 50;
}
}