I have a page that displays filters configurable on three levels:
- from config file: full list of available filters
- from DB per company: each company decides which filters to use and in what order
- from DB per user: each user enables/disables/moves filters via the UI
The ModuleConfigService generates the final $filters array.
Solution 2 (Component): The controller only passes $options. Компонент получает модуль из маршрута и использует службу для извлечения фильтров $. Concerns: risk of making the component too coupled and harder to test.
In reality, the same logic is repeated for other arrays (fields, tabs, etc.), so I’d like to avoid duplication in controllers.
How do you handle this kind of situation? Вы предпочитаете передавать все от контроллера или делегировать в компонент?
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/796 ... onsibility