17 lines
396 B
TypeScript
17 lines
396 B
TypeScript
|
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);
|
||
|
}
|
||
|
}
|