1var someEventHander=function(){
2 console.log(event,param1,param2);
3}
4//add listener
5document.getElementById("someid").addEventListener('click',someEventHander.bind(event,param1,param2));
1 // Import ElementRef,AfterViewInit from angular core
2
3 //Constructor
4 constructor(private elementRef: ElementRef) {}
5
6 ngAfterViewInit() {
7 const navbarToggler =
8 this.elementRef.nativeElement.querySelector('element');
9 navbarToggler.addEventListener('click', () => {
10 navbarToggler.classList.toggle('class');
11 });
12 }
1var someEventHander=function(event,param1,param2){
2 console.log(event,param1,param2);
3}
4//add listener
5document.getElementById("someid").addEventListener('click',someEventHander.bind(event,'param1','param2'), false);