Averos Core Module Integration

In order to integrate AverosCoreModule into an angular application, the whole module should be imported by a call to forRoot(averosConfig?: FrameworkConfiguration) method in the imports section related to the specific created application.
forRoot() accepts an FrameworkConfiguration instance that defines all the needed environment parameters depending on the desired business logic.

AverosCoreModule.forRoot({supportedLanguages: ["ar","cn","en","es","fr","de","jp","nl","no","ru","se"]}),

If you are willing to access this configuration then note that averosConfig instance could be accessed from within any angular service that is:

  • Provided in the root (providedIn: β€˜root’)
  • Implements an optional constructor parameter of type AverosConfig

Thus AverosConfig, one implementation of FrameworkConfiguration could be accessed at the angular service constructor level as shown in the example below where AverosConfig is used to perform some initialization to UserService api.

@Injectable({
  providedIn: 'root'
})
export class UserService {

  constructor(@Optional() averosConfig?: AverosConfig) { 
             if (averosConfig) { 
              /**
               * Here retrieve context parameters and perform service initialization if needed
               */

                }
              }
}