Often we wrap 3rd party plugins by define component(s), in some cases, plugin use its instance object to access properties or executes methods, something like:
var instance = $(selector).somePlugin(options);
instance.getItsOwnProperties;
instance.executeItsOwnMethod();
Problem is, these can be done inside the component easily, but we sometimes need to do those things outside the component, like in controller or parent component(s) when they nested, and mostly these requirements don’t relay on events (so I think action is not the ideal option).
My questions are:
- How to expose Plugins’ instance object to the outside world?
- Is this a good idea at all?