<h1>Rejtés</h1> <button (click)="showDiv()">Mutat</button> <br> <div [hidden]="!edited">Eredmény: {{result}}</div>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app23'; result = 30; edited = false; showDiv() { this.edited = true; } }
<h1>Rejtés</h1> <button (click)="showDiv()">Mutat</button> <br> <div *ngIf="edited">Eredmény: {{result}}</div>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app23'; result = 30; edited = false; showDiv() { this.edited = true; } }