Pytanie 1
Kod w bibliotece React.js oraz w frameworku Angular, który został zaprezentowany, ma na celu wyświetlenie
| Fragment kodu React.js: | |
state = { zm1: 0 }; hanleEv = () => { this.setState({zm1: this.state.zm1 + 1}); } render() { return (<div> <span>{this.state.zm1}</span> <button onClick={this.handleEv}>BTN_1</button> </div>); } | |
| Fragment kodu Angular: | |
@Component({ selector: 'sel1', template: `<span>{{ zm1 }}</span> <button (click)="onBtnCilcked()">BTN_1</button>` }) export class Licznik1Component { zm1 = 0; onBtnCilcked() { this.zm1++; } } |
