I need to integrate angularjs with galleria or supersize image galleries plugin.
My purpose to communicate with server on sliding of the image and the problem is that galleria has its own callbacks on different actions like on image change
Galleria.on('image', function(e) {
Galleria.log(this); // the gallery scope
});
And the problem is that how the angular js controller functions will be notified on the image change.
Newbie in angular so may be this is silly question but tried a lot to figure it out but was unable to find any thing.
thanks
If this within the callback is a DOM element you can access the scope from the controller that the element resides in using:
var controllerScope= angular.element(this).scope();
/* update a variable in scope*/
controllerScope.someVar=this.src;
/* use $apply() so angular reacts to update*/
controllerScope.$apply();
DEMO (using jQuery cycle plugin)