Advertisement
JVFabia

Untitled

Aug 13th, 2020
1,867
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component } from '@angular/core';
  2.  
  3. @Component({
  4.   selector: 'app-root',
  5.   templateUrl: './app.component.html',
  6.   styleUrls: ['./app.component.css']
  7. })
  8. export class AppComponent {
  9.   title = 'app-angular';
  10.  
  11.   fontSize= 1;
  12.  
  13.   aumentar(){
  14.     console.log("aumentar tamaño");
  15.     // test aumentar
  16.     this.fontSize += 0.1;
  17.     // capturamos el tamaño de fuente de todo el cuerpo de html "document.body.style.fontSize"
  18.     document.body.style.fontSize = this.fontSize + "em";
  19.   }
  20.  
  21.   reducir(){
  22.     console.log("reducir tamaño");
  23.     // test reducir tamaño
  24.     this.fontSize -= 0.1;
  25.     document.body.style.fontSize = this.fontSize + "em";
  26.   }
  27.  
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement