I want to pass data from HTML to the component so I\'ve created an event like this:
You can trigger click event in ngOnInit() like this: `
월 8회
{{r.value['charge']}}
`
In component.ts file
import { Component, OnInit, AfterViewInit, ElementRef, ViewChild } from '@angular/core';
@Component({
//component decoraters
})
export class MyComponent implements OnInit, AfterViewInit {
@ViewChild('divClick') divClick: ElementRef;
ngOnInit() {
// your other code
setTimeout(() => {
this.divClick.nativeElement.click();
}, 200);
}
}