import { AfterViewInit , Component } from '@angular/core' ; import { FormBuilder , Validators } from '@angular/forms' ; import { MatomoTracker } from 'ngx-matomo' ; @ Component ( { selector : 'app-form' , templateUrl : './form.component.html' , styleUrls : [ ] , } ) export class FormComponent implements AfterViewInit { public foodForm = this . formBuilder . group ( { favorite : [ '' , Validators . required ] , comment : [ '' ] , } ) ; param formBuilder param matomoTracker constructor ( private readonly formBuilder , private readonly matomoTracker ) { } /**
     * Angular AfterViewInit lifecycle hook.
     */ ngAfterViewInit ( ) { } onSubmit ( ) { console . log ( 'Submit!' ) ; } }