Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div style="border:1px solid;padding:10px;" *ngIf="show" class="old">
- Hello how are you
- </div>
- <button style="position:absolute;left: 28%;top: 16px;" (click)="change()">change</button>
- import { Component } from '@angular/core';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent {
- toggle:boolean = true;
- show:any;
- change(){
- this.show = !this.show;
- }
- ngOnInit() {
- this.show = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement