Advertisement
xxxxbe

validator.component.ts

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