I put the *ngIf condition on one of my buttons, which appears if certain fields are checked, it calls the geolocation() function when clicked. Instead, I want to automatically run this function as soon as ngIf is ngIf . I remember using ng-init for this with angular 1.x, but now it does not work, and *ngInit does not work.
<button *ngIf="!venueNameInput.control.valid && !address1Input.control.valid" (click)="geolocation()">Test Dojo Geolocation</button>
source share