Random
This commit is contained in:
parent
d1db066c74
commit
4c94212b7f
14 changed files with 567 additions and 349 deletions
6
src/app/Parent/parent.component.html
Normal file
6
src/app/Parent/parent.component.html
Normal 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>
|
17
src/app/Parent/parent.component.ts
Normal file
17
src/app/Parent/parent.component.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue