Angular
|
|
Título del Test:
![]() Angular Descripción: Information about it |



| Comentarios |
|---|
NO HAY REGISTROS |
|
When using the modern bootstrapApplication(RootComponent, config) function to start your Angular app, what is a strict requirement for the RootComponent regarding its metadata anatomy?. It must be declared in an NgModule before being passed to the function. It must have the standalone: true property set in its @Component decorator. It must contain a providers: [] array that includes provideRouter and provideHttpClient. When setting up a modern Angular app, where is the most architecturally sound place to define your providers (like your Router or Global State) to ensure they are available to the entire application tree as singletons?. Inside the providers: [] array of the RootComponent decorator. Inside the ApplicationConfig object passed as the second argument to bootstrapApplication. Inside the imports: [] array of the RootComponent metadata. If your RootComponent (the one passed to bootstrapApplication) uses a standard directive like NgIf or a custom Standalone Directive in its template, you must include that directive in the imports array of the RootComponent metadata, even though it was bootstrapped globally. True. False. If your appConfig (passed to bootstrapApplication) includes an APP_INITIALIZER provider that returns a Promise or Observable, what is the effect on the Root Component's ngOnInit lifecycle hook?. ngOnInit will execute immediately in parallel with the initializer to speed up the "Time to Interactive.". The Root Component will not be instantiated, and ngOnInit will not run until the APP_INITIALIZER completes. ngOnInit runs first, but the template remains hidden until the initializer resolves. When you bootstrap an application using bootstrapApplication(AppComponent, config), it returns a Promise. To manually trigger the ngOnDestroy hook of the AppComponent and all its children for a clean shutdown, what must you do?. Simply set the AppComponent instance to null. Resolve the promise to get the ApplicationRef and call its .destroy() method. Call ngOnDestroy() directly on the root component instance. In a standalone application, the ngOnDestroy hook of your bootstrapped Root Component is automatically guaranteed to execute if the user closes the browser tab or performs a hard refresh of the page. True. False. |





