En un componente Angular 12 tengo lo siguiente:
export class SignUpComponent implements OnInit { environment: Environment; form: FormGroup; stage: number; constructor( private router: Router, private title: Title, private formBuilder: FormBuilder, private analyticsService: AnalyticsService, private environmentService: EnvironmentService) { this.environment = this.environmentService.get(); this.title.setTitle('Registar - Bons Alunos'); this.analyticsService.pageview('Sign Up', this.router.url); this.form = this.formBuilder.group({ email: ['', [Validators.required, Validators.email]] }); this.stage = 1; } ngOnInit() { }Pregunta
¿Qué debo mover del constructor del componente al método ngOnInit ?
¿Qué tipo de código debo colocar en ngOnInit que no puede/no debe estar en el constructor?