This class provides multiple ways to consume EnvironmentState properties synchronously and asynchronously, plus other options like marking properties as required, interpolating values in properties, etc. Typically this will be the class that is exposed to the rest of the application to get the properties.
The environment query is an interface that must be implemented to get the environment values. Can be integrated into any application using the provided default implementation or a custom one.
Below are examples of the expected behavior and some implementation examples. To learn more about environment query and how to create them you can read the documentation.
Angular Environment Query
This class provides multiple ways to consume EnvironmentState properties synchronously and asynchronously, plus other options like marking properties as required, interpolating values in properties, etc. Typically this will be the class that is exposed to the rest of the application to get the properties.
The environment query is an interface that must be implemented to get the environment values. Can be integrated into any application using the provided default implementation or a custom one.
DefaultEnvironmentQuery
The default environment query implementation to get the environment values.
This query is provided by defaut when running
EnvironmentModule.forRoot()
, but can be provided manually.Unless
ENVIRONMENT_QUERY_CONFIG
is provided, the initial query config isnull
.ENVIRONMENT_QUERY_CONFIG
The
ENVIRONMENT_QUERY_CONFIG
injection token contains the configuration parameters for the environment query.The default value provided by
EnvironmentModule.forRoot()
isnull
, but can be set in configuration.Use cases
Below are examples of the expected behavior and some implementation examples. To learn more about environment query and how to create them you can read the documentation.
Table of Contents
Create a custom query
To create a custom environment query that uses
ENVIRONMENT_QUERY_CONFIG
simply complete the next class.Once implemented must be provided:
EnvironmentModule.forRoot()
.