I am using ElementRef to access DOM elements, but I am getting an error,
generic type ElementRef requires 2 type arguments angular 6
This is code
Import
import { Component, OnInit, Input, ElementRef, Renderer2, AfterViewInit, ViewChild, ChangeDetectorRef, OnDestroy } from '@angular/core';
Code
@ViewChild("transDtls") transModal: ElementRef;
The above code is the syntax I have seen in most sites, I have tried using this way
@ViewChild("transDtls") transModal: ElementRef<HTMLElement, any>;
which I saw in other site, it solved error in IDE, but I`m getting error in console while ng serve
ERROR in src/app/view/menu/transactions/transactions.component.ts(39,41): error TS2707: Generic type 'ElementRef' requires between 0 and 1 type arguments.
Because of this I couldn't use ElementRef, Kindly help I`m new to angular.