Wednesday, 28 March 2018

Ng4-ViewChild - Show ratio button based on condition using ViewChild

Ng4-ViewChild - Show ratio button based on condition using ViewChild
=======================================================

<input id="EXCEL" name="EXCEL" value="EXCEL" type="radio" #radioCheckedExcel/>

import { Component, Output,OnInit,Input, EventEmitter, ViewChild, ElementRef } from '@angular/core';

export class NewReportsComponent implements OnInit {

  @ViewChild('radioCheckedExcel') private radioCheckedExcel: ElementRef;
 
 
  EventTriggerFunciton(){
  this.radioCheckedExcel.nativeElement.checked = true;
  }
 
  ResetRatioButton(){
  this.radioCheckedExcel.nativeElement.checked = false;
  }

No comments:

Post a Comment

Tanstack query vs React Fetch -Axios

import { useQuery } from "@tanstack/react-query"; function Users() { const { data, isLoading, isError, error } = useQuery({ ...