You have a logging service that logs errors to the console in the development environment and sends them to the server in the production environment. How can you switch between different implementations of the logging service depending on the environment?
- Using 'app.module.ts' file
- Using 'config.json' file
- Using 'environment.ts' configuration
- Using a separate service for each environment
To switch between different implementations of the logging service based on the environment, you can use the 'environment.ts' configuration, which allows you to specify different configurations for each environment.
Loading...
Related Quiz
- You're building a type-ahead search feature in an Angular application. The user input should trigger API calls, but you want to avoid making unnecessary calls for every keystroke. Which RxJS operators can help optimize this?
- Which feature in Angular allows you to create custom HTML elements that can be used outside Angular applications?
- When you want to bind a DOM event to a method in your component class, you use event binding.
- The router-outlet directive acts as a _____ where the routed component is displayed.
- The _____ decorator in a component class binds a property inside the component to a value that is passed from outside the component.