To check if a form control's value has been changed by the user, you can check the _____ property.
- dirty
- pristine
- touched
- value
To check if a form control's value has been changed by the user, you can check the dirty property. The "dirty" state means the control has been touched or modified.
In Angular, you can group together multiple form controls into a single logical unit using _____ .
- ControlUnit
- FormControlGroup
- FormDirective
- FormGroup
In Angular, you can group together multiple form controls into a single logical unit using a FormGroup.
You are working on an Angular application where a component is making multiple HTTP requests and you notice that the component is causing memory leaks. What approach can you use to solve this issue while making the code cleaner?
- Implement garbage collection strategies
- Manually unsubscribe from observables
- Use HttpClientInterceptor
- Use the async pipe
To solve memory leaks and make the code cleaner, you can use the async pipe, which automatically manages subscriptions and unsubscribes when the component is destroyed.
How does Angular Elements enable the usage of Angular components in non-Angular environments?
- By converting components to Web Components
- By embedding Angular components as iframes
- By running Angular components in iframes
- By using Angular services for integration
Angular Elements enables the usage of Angular components in non-Angular environments by converting components to Web Components, making them platform-agnostic and usable in different frameworks or plain HTML pages.
To navigate to a route conditionally based on the data fetched, you can use a Route Resolver along with the _____ Router Event.
- Activate
- Deactivate
- Navigate
- Resolve
To navigate to a route conditionally based on the data fetched, you can use a Route Resolver along with the Resolve Router Event. The Resolve event allows you to fetch data before navigating to the route.
How can you ensure that an Observable sequence retries a specific number of times after encountering an error before finally failing?
- catchError with a custom error handler
- finalize with a custom completion handler
- repeatWhen with a custom completion handler
- retryWhen with a custom error handler
To ensure that an Observable sequence retries a specific number of times after an error, you can use the retryWhen operator with a custom error handler.
The _____ decorator allows you to access route parameters within an Angular component.
- ActivatedRoute
- ParamInjector
- RouteParam
- RouterParam
The ActivatedRoute decorator allows you to access route parameters within an Angular component and retrieve data from the URL.
What type of data binding is used when you want to send data from a component's class to its template?
- Event binding
- Interpolation binding
- One-way data binding
- Two-way data binding
In Angular, Two-way data binding is used when you want to send data from a component's class to its template, allowing data to flow in both directions between the component and the template.
When you want to bind a DOM event to a method in your component class, you use event binding.
- event binding
- interpolation binding
- property binding
- two-way binding
In Angular, event binding is used to bind a DOM event to a method in your component class, allowing you to respond to user interactions.
If you need to multicast a single source Observable to multiple observers, you would use a _____.
- forkJoin
- multicast
- subscribe
- toPromise
If you need to multicast a single source Observable to multiple observers, you would use a multicast.