Service Injection
Geocortex Web uses dependency injection as a way to obtain a reference to Geocortex Web services in your application. Services can be referenced from within a component model.
note
If a custom command or operation can accomplish the behavior you need without a direct service reference, this is preferred to decrease the degree of coupling.
The @inject
decorator can be used to reference a service from within your component model. The following example demonstrates injecting the RegionService
into a custom component model.
The property that the @inject
decorator is bound to will be populated during the initialization process of the component model that the decorator was used in. The property value will be undefined
until the component model is initialized.