Advertisement
xxxxbe

Untitled

Jun 22nd, 2020
2,700
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, OnInit, Input } from '@angular/core';
  2.  
  3.  
  4. @Component({
  5.   selector: 'app-validador',
  6.   templateUrl: './validador.component.html',
  7.   styleUrls: ['./validador.component.scss']
  8. })
  9. export class ValidadorComponent implements OnInit {
  10.  
  11.   @Input() ValueType:string;
  12.   @Input() ValueClass:string;
  13.   ValidClass:string;
  14.  
  15.  
  16.  
  17.   constructor() { }
  18.  
  19.   ngOnInit(): void {
  20.     /*conditional if for validation*/
  21.  
  22.  
  23.     switch(color){
  24.       case this.ValueType == "val":{
  25.         this.ValidClass = "val-span"
  26.         console.log("span1");
  27.         break;
  28.       }
  29.        case this.ValueType == "rec":{
  30.          this.ValidClass = "rec-span"
  31.          console.log("span1");
  32.          break;
  33.        }
  34.        case this.ValueType == "env":{
  35.          this.ValidClass = "env-span"
  36.          console.log("span1");
  37.          break;
  38.        }
  39.     }
  40.  
  41.  
  42.     //console.log("entra");
  43.  
  44.   }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement