With commit 1ce80fa I implemented a callback system in order to be able to:
- automatically get data (also on updates) from
envControlDataService to module hardwareIrTrans
- be able to update data from
hardwareIrTrans to envControlDataService which eventually saves the data to file via ARE.
So in the end a two-way communication between envControlDataService and hardwareIrTrans is needed.
However it is not possible to just include the modules with angularJS dependency injection because it will result in a circular dependency circle, which leads to an angularJS error.
The current implementation is not the prettiest and in the end the architecture should be refactored in this way:
- there is one
dataService which is responsible only for storing data to ARE and notify other modules about updated data.
- retrieving and saving data to this service will be done with public service methods
- notifications about changes of the saved data will be done by a subscriber system. So all modules that want to be updated about data updates have to register to updates with a callback. Maybe the observer pattern would fit for this purpose: https://en.wikipedia.org/wiki/Observer_pattern
Currently the dependencies look about like this:

With commit 1ce80fa I implemented a callback system in order to be able to:
envControlDataServiceto modulehardwareIrTranshardwareIrTranstoenvControlDataServicewhich eventually saves the data to file viaARE.So in the end a two-way communication between
envControlDataServiceandhardwareIrTransis needed.However it is not possible to just include the modules with angularJS dependency injection because it will result in a circular dependency circle, which leads to an angularJS error.
The current implementation is not the prettiest and in the end the architecture should be refactored in this way:
dataServicewhich is responsible only for storing data toAREand notify other modules about updated data.Currently the dependencies look about like this:
