Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <div style="border:1px solid;padding:10px;" *ngIf="show" class="old">
  2. Hello how are you
  3. </div>
  4. <button style="position:absolute;left: 28%;top: 16px;" (click)="change()">change</button>
  5.  
  6. import { Component } from '@angular/core';
  7.  
  8. @Component({
  9. selector: 'app-root',
  10. templateUrl: './app.component.html',
  11. styleUrls: ['./app.component.css']
  12. })
  13. export class AppComponent {
  14. toggle:boolean = true;
  15. show:any;
  16. change(){
  17. this.show = !this.show;
  18. }
  19.  
  20. ngOnInit() {
  21. this.show = false;
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement