I am utilizing user-contributed modules that I aim to avoid editing in order to make upgrades easier.
My goal is to enable users to browse for a CSV file on the local filesystem, parse it, and display it in a dynamic table. For this task, I am using PapaParse
, ui.grid
, and angularFileUpload
.
The issue I am facing is that these components operate at different levels within the hierarchy.
While angularFileUpload works seamlessly by calling a function in my controller (using the controllerAs syntax) to convert the CSV file to a JSON object using PapaParse, the problem arises with ui.grid
. Since ui.grid operates on the $scope object as an attribute directive, it does not support watchers to monitor changes to a variable. This requires calling a function upon data update to re-bind the data.
Hence, my question is: how can I communicate with an external directive from within my controller without modifying the directive to listen for messages?